【发布时间】:2012-06-18 18:46:14
【问题描述】:
我正在使用 ASP.Net MVC3 和 ADFS(使用被动联合)创建单页应用程序 (SPA)。除了我称之为“从 ADFS 重新验证”之外,一切都按预期工作。网站将定期(少于 30 分钟)尝试使用 STS 重新验证用户身份。这很好,但是 Web 应用程序是作为单页应用程序构建的,因此一旦页面加载,我们就永远不会重新加载页面。此外,重认证请求通常发生在 ajax 调用期间。
ADFS 具有 WebSSOLifetime 和 TokenLifetime 的默认设置。
有没有办法:a) 在后台通过 javascript 静默重新验证用户身份(可能创造性地使用 CORS 和/或 JSONP)?或 b) 延长重新认证请求之间的时间?或 c) 别的东西。
关于 b) 似乎我可以设置 persistentCookiesOnPassiveRedirects="true" 然后在 cookieHandler 中将 persistentSessionLifetime 设置为所需的值。
<wsFederation persistentCookiesOnPassiveRedirects="true" passiveRedirectEnabled="true" issuer="xxx" realm="yyy" requireHttps="true" />
<cookieHandler requireSsl="true" persistentSessionLifetime="0.8:0:0" path="/" />
但是,我不想使用持久性 cookie。
最后,我使用了此处描述的 Freshness 设置:How to set the timeout properly when federating with the ADFS 2.0,但没有成功。
任何帮助将不胜感激。
【问题讨论】: