2017-09-15 41 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協商。