HTTP请求未经客户端身份validationscheme“协商”授权。从服务器收到的validation头是“NTLM”

HTTP请求未经客户端身份validationscheme“协商”授权。从服务器收到的validation头是“NTLM”,第1张

概述HTTP请求未经客户端身份validationscheme“协商”授权。 从服务器收到的validation头是“NTLM”

几天前,我在客户端和wcf web服务之间使用windows身份valIDation时遇到了身份valIDation问题。 我得到的错误是“http请求是未经授权的客户端身份valIDationscheme”Negotiate“,从服务器接收到的身份valIDation头是”NTLM“,堆栈上的解决scheme都没有工作,因为大部分解决scheme都与旧方法有关。

在Nginx上使用一次性cookie非常简单的authentication

如何通过SOAP进行windows liveauthentication(RST)

Apache 2.4“..authentication失败..:密码不匹配”

与.NET集成的Ruby on Rails的状态是什么?

为什么logonUserW失败,错误代码为183(ERROR_ALREADY_EXISTS)

答案:问题是这个问题的所有帖子都与代理证书或AllowNTLM属性帮助的较老的kerberos和IIS问题有关。 我的情况是不同的。 我从几乎所有的地方发现蠕虫之后发现的是,有些IIS安装不包括在IIS windows身份验证提供程序列表下的协商提供程序。 所以我不得不把它添加并移动。 我的WCF服务开始按预期进行身份验证。 下面是如果您使用匿名身份验证OFF的windows身份验证应该看起来的屏幕截图。

您需要右键单击windows身份验证并选择提供程序菜单项。

希望这有助于节省一些时间。

我已经将WCF的旧版本升级到WCF 4,并希望您也可以做出类似的更改。

1. Web.config:

<system.serviceModel> <bindings> <basichttpBinding> <binding name="Demo_Basichttp"> <security mode="TransportCredentialOnly"> <transport clIEntCredentialType="inheritedFromHost"/> </security> </binding> </basichttpBinding> </bindings> <services> <service name="DemoServices.CalculatorService.ServiceImplementation.CalculatorService" behaviorConfiguration="Demo_ServiceBehavior"> <endpoint address="" binding="basichttpBinding" bindingConfiguration="Demo_Basichttp" contract="DemoServices.CalculatorService.ServiceContracts.ICalculatorServiceContract"> <IDentity> <dns value="localhost"/> </IDentity> </endpoint> <endpoint address="mex" binding="mexhttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="Demo_ServiceBehavior"> <!-- To avoID disclosing Metadata information,set the values below to false before deployment --> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <!-- To receive exception details in faults for deBUGging purposes,set the value below to true. Set to false before deployment to avoID disclosing exception information --> <serviceDeBUG includeExceptionDetailinFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <protocolMapPing> <add scheme="http" binding="basichttpBinding" bindingConfiguration="Demo_Basichttp"/> </protocolMapPing> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel>

2. App.config:

<system.serviceModel> <bindings> <basichttpBinding> <binding name="BasichttpBinding_ICalculatorServiceContract" maxBufferSize="2147483647" maxBufferPoolSize="33554432" maxReceivedMessageSize="2147483647" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00"> <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="4096" /> <security mode="TransportCredentialOnly"> <transport clIEntCredentialType="Ntlm" proxyCredentialType="None" realm="" /> </security> </binding> </basichttpBinding> </bindings> <clIEnt> <endpoint address="http://localhost:24357/CalculatorService.svc" binding="basichttpBinding" bindingConfiguration="BasichttpBinding_ICalculatorServiceContract" contract="ICalculatorServiceContract" name="Demo_Basichttp" /> </clIEnt> </system.serviceModel>

对我来说,解决方案除了使用“Ntlm”作为证书类型:

XxxSoapClIEnt xxxClIEnt = new XxxSoapClIEnt(); ApplyCredentials(username,password,xxxClIEnt.ClIEntCredentials); private static voID ApplyCredentials(string username,string password,ClIEntCredentials clIEntCredentials) { clIEntCredentials.Username.Username = username; clIEntCredentials.Username.Password = password; clIEntCredentials.windows.ClIEntCredential.Username = username; clIEntCredentials.windows.ClIEntCredential.Password = password; clIEntCredentials.windows.AllowNtlm = true; clIEntCredentials.windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; }

对我来说,解决方案是将AppPoolIDentity设置为AppPoolIDentity为NetworkService标识。

总结

以上是内存溢出为你收集整理的HTTP请求未经客户端身份validationscheme“协商”授权。 从服务器收到的validation头是“NTLM”全部内容,希望文章能够帮你解决HTTP请求未经客户端身份validationscheme“协商”授权。 从服务器收到的validation头是“NTLM”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1277447.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存