2017-06-09 76 views
0

我有關於此功能的問題。 登錄操作適用於ADFS並返回到AuthServices/Acs 但註銷操作不會調用ADFS並直接重定向到returnUrl參數(使用fiddler檢查它)。 我打電話此鏈接:/AuthServices/Logout?ReturnUrl=~/&Status=LoggedOutKentor MVC註銷不呼叫註銷網址

web.config中被設置爲這樣:

<kentor.authServices entityId="https://localhost:2181/AuthServices" returnUrl="https://localhost:2181/"> 
    <identityProviders> 
     <add 
     entityId="https://ADFS DOMAIN/adfs/services/trust" 
     signOnUrl="https://ADFS DOMAIN/adfs/ls" 
     logoutUrl="https://ADFS DOMAIN/adfs/ls/?wa=wsignout1.0" 
     binding="HttpPost" 
     allowUnsolicitedAuthnResponse="true" 
     metadataLocation="https://ADFS DOMAIN/FederationMetadata/2007-06/FederationMetadata.xml" 
     wantAuthnRequestsSigned="true"> 
     <signingCertificate fileName="~/App_Data/*****.cer" /> 
     </add> 
    </identityProviders> 
    </kentor.authServices> 

如果我在另一個選項卡推出https://ADFS DOMAIN/adfs/ls/?wa=wsignout1.0,這是工作,我登錄頁面上的返回從我的網站。

所以它似乎是一個內部問題來檢索logouturl併發送它?

感謝您的幫助。

回答

0

有許多問題需要之前註銷請求將發出滿足的要求:

  1. 你需要有一個http://kentor.se/AuthServices/LogoutNameIdentifier要求及其發行人有權匹配你要登出IDP從。
  2. 您需要擁有http://kentor.se/AuthServices/SessionIndex聲明。
  3. 你AuthServices IDP配置需要一個logoutUrl(我看你指定這一點,但也許更容易讓AuthServices從元數據讀取它)
  4. 您指定與任何簽名或兩種用途的ServiceCertificate(即不只是加密)
  5. 你AuthServices IDP配置有DisableOutboundLogoutRequests = 假(這是默認)

失蹤索賠(前兩個點)是最有可能的問題,如果您有登錄過程中的一些聲明轉換髮生或你是不是保留原來的ClaimsIdent性。另請參閱有關ClaimsAuthenticationManager的文檔,例如https://github.com/KentorIT/authservices/blob/master/doc/ClaimsAuthenticationManager.md

您可以打開日誌記錄,看看這些點都沒有: https://github.com/KentorIT/authservices/blob/v0.21.2/Kentor.AuthServices/WebSSO/LogOutCommand.cs#L155-L170

+0

謝謝您的答覆。 ADFS不會將claimtype發送爲http://kentor.se/AuthServices/LogoutNameIdentifier或http://kentor.se/AuthServices/SessionIndex。我如何設置web.config(或者也許是adfs)來做到這一點?但adfs不在我身邊。 –

+0

ADFS不發送它們,但默認的AuthServices ACS代碼在登錄過程中將它們添加到標識中。我在 – explunit

+0

上面的答案中添加了ClaimsAuthenticationManager的鏈接。另請參閱此處的一些討論:https://github.com/KentorIT/authservices/issues/665 – explunit