[英]ACS doesn't process SAML response in a sub-application
我正在努力尋找這種行為的原因。 我有一個配置了 SustainSys 包的簡單 MVC 應用程序。 我已經嘗試為我們的內部 SecureAuth 服務器和https://stubidp.sustainsys.com測試服務器配置它。
當它是我們內部 IIS 服務器的根應用程序時,這一切都適用於 localhost。
當我將它放在 IIS 子應用程序文件夾中時,它會重定向到 sso 服務器登錄名,返回到帶有身份驗證信息的 ~/Saml2/Acs 路由(我在 fiddler2 中看到它),但 Acs 似乎沒有在那一點處理它,我仍然未經身份驗證,因此它返回到登錄頁面,我開始循環。
我知道子應用程序的 web.config 繼承,所以我什至從根目錄中刪除了 web.config,所以沒有任何與子應用程序中的沖突。 我使用 returnURL 參數無效(包括或不包括 sudirectory)。
IIS 中的應用程序(根應用程序和子應用程序)的身份驗證配置相同。
我已經沒有想法可以測試了。 有人有什么想法嗎?
<sustainsys.saml2 entityId="https://apps.xxxxx.com" returnUrl="https://apps.xxxxx.com/yyyyy">
<identityProviders>
<add entityId="https://sso.xxxxx.com/SecureAuthXX" signOnUrl="https://sso.xxxxx.com/SecureAuthXX" allowUnsolicitedAuthnResponse="true" binding="HttpRedirect">
<signingCertificate fileName="~/App_Data/SecureAuth03VM.xxxxx.com.cer" />
</add>
</identityProviders>
<federations>
<add metadataLocation="https://apps.xxxxx.com/Federation" allowUnsolicitedAuthnResponse="true" />
</federations>
</sustainsys.saml2>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" name="CookieAuth" />
</federationConfiguration>
</system.identityModel.services>
我解決了這個問題,我想發布修復它的內容,因為也許有一天它可能會幫助其他人。
問題不在於 SAML 響應或 Sustainsys 庫,而在於 web.config 中缺少 的屬性。 將“path='/'”添加到聯合配置中的 cookiehandler 元素后(見下文),它開始在 System.Security.Principal 中持久化授權狀態,現在在根應用程序以及所有子應用程序中完美運行.
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" name="FedAuth" path="/" />
</federationConfiguration>
</system.identityModel.services>
<edit>我認為</edit>這可能會出錯有兩個步驟:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.