簡體   English   中英

SSPI協商失敗WSTrustChannelFactory

[英]SSPI negotiation failed WSTrustChannelFactory

這已經有一段時間了,我正在嘗試構建一個可以調用.net Web / wcf服務SP的控制台應用程序,第一步是從IDP(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;
}

就我而言,由於某種原因,ADFS可通過VPN使用,但基於AD的身份驗證位不會通過VPN發生。 這就是SEC_E_DOWNGRADE_DETECTED即將到來的原因。 在常規的非VPN環境中,情況很好。

同樣,另一個觀察結果是一旦在常規企業網絡上生成了SAML令牌。 即使在VPN上,后續生成SAML令牌的調用也按預期進行。

因此,如果看到此錯誤,請檢查您所在的網絡是否屬於域的一部分(而不是公共或專用網絡),以進行SSPI協商。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM