2017-09-15 117 views
0

这其中有我,我想建立一个控制台应用程序可以调用.NET的Web/WCF服务的SP,第一站是获得从IDP(ADFS4令牌。 0)粘贴代码工作正常了整整一天,在某个时候停止,出现以下错误工作:SSPI谈判,而现在失败WSTrustChannelFactory

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("[email protected]"))); 
    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; 
} 

回答

0

在我的情况下,出于某种原因,在ADFS是可通过VPN但AD的身份验证位没有发生过VPN。这就是SEC_E_DOWNGRADE_DETECTED即将到来的原因。在常规的非VPN环境中,情况很好。

此外,另一个观察是一旦在常规企业网络上生成SAML令牌。即使在VPN上,后续的生成SAML令牌的调用也会按预期进行。

所以,如果你看到这个错误只是检查网络你是在是域的一部分(而不是公共或专用网络),为SSPI协商。