简体   繁体   English

带有 .NET 核心的 SSRS 报告,HTTP 请求未经客户端身份验证方案“Ntlm”授权

[英]SSRS report with .NET Core, The HTTP request is unauthorized with client authentication scheme 'Ntlm'

I'm trying to generate an SSRS report from .NET Core application and I'm following this tutorial我正在尝试从 .NET 核心应用程序生成 SSRS 报告,我正在关注本教程
But I'm getting the following exception但我收到以下异常

The HTTP request is unauthorized with client authentication scheme 'Ntlm'. HTTP 请求未经客户端身份验证方案“Ntlm”的授权。 The authentication header received from the server was 'NTLM'.从服务器收到的身份验证 header 是“NTLM”。

When I remove the credentials and use BasicHttpSecurityMode.None with HttpClientCredentialType.None everything is working fine but I need to add credentials to the service当我删除凭据并将BasicHttpSecurityMode.NoneHttpClientCredentialType.None一起使用时,一切正常,但我需要向服务添加凭据

I know there are many answers to this error but I've tried almost all of them but nothing is working for me我知道这个错误有很多答案,但我已经尝试了几乎所有的答案,但没有什么对我有用

Here is what I've tried:这是我尝试过的:

I tried to add ProxyCredentialType to be Ntlm but I got the same error我试图将ProxyCredentialType添加为Ntlm但我得到了同样的错误

var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.MaxReceivedMessageSize = 10485760; //10MB limit
var rsExec = new ReportExecutionServiceSoapClient(binding, new EndpointAddress(SSRSReportExecutionUrl));
var clientCredentials = new NetworkCredential(SSRSUsername, SSRSPassword, ".");
if (rsExec.ClientCredentials != null)
            {
                rsExec.ClientCredentials.Windows.AllowedImpersonationLevel =System.Security.Principal.TokenImpersonationLevel.Impersonation;
                rsExec.ClientCredentials.Windows.ClientCredential = clientCredentials;
            }

Also I tried to replace HttpClientCredentialType.Ntlm with HttpClientCredentialType.Windows but I got this error我也尝试用HttpClientCredentialType.Ntlm替换HttpClientCredentialType.Windows但我收到了这个错误

System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. System.ServiceModel.Security.MessageSecurityException:HTTP 请求未通过客户端身份验证方案“协商”进行授权。 The authentication header received from the server was 'NTLM'从服务器收到的身份验证 header 是“NTLM”

Some answers suggest modifying web.config file or using Microsoft Service Configuration Editor to edit it but I don't found this file or this editor in my case, I think these exist in .NET framework, not .NET core but I'm not sure一些答案建议修改web.config文件或使用 Microsoft 服务配置编辑器对其进行编辑,但在我的情况下我没有找到此文件或此编辑器,我认为这些存在于 .NET 框架中,而不是 Z303CB0EF9EDB9082D61BBBE5825D972 核心但不确定

Any idea what should I do to fix this error?知道我该怎么做才能解决此错误吗?

As far as I know, most of the cases on the web are deployed with IIS and verified using Windows Authentication.据我所知,web 上的大多数案例都是使用 IIS 部署的,并使用 Windows 身份验证进行验证。 If you're using IIS, only change the Windows Authentication enabled and try following the steps in this article .如果您使用的是 IIS,只需更改启用 Windows 身份验证并尝试按照本文中的步骤操作。

If it doesn't work out, try using Kerberos and registering an SPN before using it.如果不起作用,请尝试使用 Kerberos 并在使用前注册 SPN。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HTTP 请求未经客户端身份验证方案“Ntlm”授权 - The HTTP request is unauthorized with client authentication scheme 'Ntlm' 使用客户端身份验证方案“ Ntlm”对HTTP请求进行了未授权。从服务器收到的身份验证标头为“ NTLM” - The HTTP request is unauthorized with client authentication scheme 'Ntlm' The authentication header received from the server was 'NTLM' HTTP请求未经授权使用客户端身份验证方案'Ntlm'。 从服务器收到的身份验证标头是“Negotiate,NTLM” - The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'Negotiate,NTLM' HTTP请求未经授权使用客户端身份验证方案“Negotiate”。从服务器收到的身份验证标头是'NTLM' - The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM' 未经授权使用客户端身份验证方案 NTLM - Unauthorized with client authentication scheme NTLM 客户端身份验证方案“ Ntlm”不允许HTTP请求 - HTTP request is not allowed for client authentication scheme “Ntlm” 呼叫清单.asmx取得'http要求是未经授权的客户端身份验证方案'ntlm' - call lists.asmx getting 'http request is unauthorized with client authentication scheme 'ntlm' 调用 SAP PI Web 服务时,HTTP 请求未经客户端身份验证方案“Ntlm”授权 - The HTTP request is unauthorized with client authentication scheme 'Ntlm' while calling SAP PI web service 使用客户端身份验证方案“匿名”对HTTP请求进行未经授权的授权? - The HTTP request is unauthorized with client authentication scheme 'Anonymous'? HTTP请求未经授权使用客户端身份验证方案“Negotiate”。 身份验证标头 - The HTTP request is unauthorized with client authentication scheme 'Negotiate'. the authentication header
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM