[英]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.