Windows Identity Foundation - relying party session security token lifetime

别来无恙 提交于 2019-12-13 03:38:33

问题


I'm using Windows Identity Foundation (WIF) for authentication in my ASP.NET MVC 3 project. I've created simple security token service (STS) using default template available in the SDK (ASP.NET site with forms authentication).

Everything works fine, apart from the fact that my security session token lifetime (the one that is being generated on the relying party (RP), i.e. ASP.NET MVC site) seems to be set to 10 minutes despite that STS generated security token has lifetime of 1 hour.

I've tried to change token lifetime on the STS itself and lifetime of security session token generated on the RP in the SessionAuthenticationModule_SessionSecurityTokenReceived event. Same result - after 10 minutes RP redirects client to STS for authentication.

It seems that I'm missing something really obvious but I can't put my finger on it. Would really appreciate if someone could help me out.


回答1:


The token your STS issues and the session cookie your RP application establishes are two separate things, both have their own lifetimes. After the token is consumed by your RP, its lifetime has no effect on the lifetime of the cookie that your RP creates to establish a session. But you can configure your session lifetime in your web.config like so:

How do I increase session timeout with W.I.F / SAML tokens / FedAuth cookie



来源:https://stackoverflow.com/questions/9972005/windows-identity-foundation-relying-party-session-security-token-lifetime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!