这一段时间以来,我一直在尝试构建一个可以调用.net web/wcf服务SP的控制台应用程序,第一步是从idP (ADFS4.0)获得一个令牌(ADFS4.0),粘贴的代码工作了一整天,在某个时候它停止了处理以下错误:
SOAP security negotiation with 'https://adfs.domain.in/adfs/services/trust/13/windowsmixed' for target 'https://adfs.domain.in/adfs/services/trust/13/windowsmixed' failed. See inner exception for more details.
内部错误是:
The Security Support Provider Interface (SSPI) negotiation failed.
NativeErrorCode: 0x80090350 -> SEC_E_DOWNGRADE_DETECTED
我尝试过/13/windows和/windowstransport以及端点。
private static GenericXmlSecurityToken RequestSecurityToken()
{
// set up the ws-trust channel factory
var factory = new Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory(new WindowsWSTrustBinding(
SecurityMode.TransportWithMessageCredential), new EndpointAddress(new Uri("https://adfs.domain.in/adfs/services/trust/13/windowsmixed"), EndpointIdentity.CreateSpnIdentity("adfs@domain.in")));
factory.TrustVersion = TrustVersion.WSTrust13;
var rst = new RequestSecurityToken
{
RequestType = RequestTypes.Issue,
KeyType = KeyTypes.Bearer,
AppliesTo = new System.ServiceModel.EndpointAddress(endpoint_address)
};
// request token and return
return factory.CreateChannel().Issue(rst) as GenericXmlSecurityToken;
}发布于 2017-09-19 07:58:26
在我的例子中,由于某种原因,ADFS可以在VPN上使用,但是基于AD的身份验证位没有发生在VPN上。这就是为什么SEC_E_DOWNGRADE_DETECTED要来了。在常规的非VPN环境中,事情是好的。
另外,一旦在常规企业网络上生成SAML令牌,另一个观察就是。生成SAML令牌的后续调用正在按预期进行,甚至在VPN上也是如此。
因此,如果您看到此错误,只需检查您所在的网络是否是域(而不是公共或专用网络)的一部分,以便进行SSPI协商。
https://stackoverflow.com/questions/46243162
复制相似问题