如何使安全令牌在被动 STS 设置中自动过期?
我为我正在开发的新应用程序设置了被动 STS。
我注意到当用户的会话过期时,用户仍然经过身份验证。我本以为当会话过期时,用户将不再被验证。我的老板与我讨论了这个问题,因为我目前负责设置身份验证。他说,如果我们能让用户的登录在一段时间内不活动后过期,就像会话过期一样,那就太好了。
我熟悉如何使用几行代码来注销用户。如何使用户在指定的不活动时间段后自动注销?
目前,我在 global.asax
文件中有一些代码,它们以编程方式检查上次请求的时间并将其与当前时间进行比较;如果过了一定时间,它就会让用户退出。
I have a passive STS set up for a new application I'm working on.
I've noticed that when a user's session expires, the user is still authenticated. I would have thought that when the session expires, the user would no longer be authenticated. My boss discussed this with me as I am currently charged with setting up the authentication. He says that it would be good if we could make the user's log on expire after a certain period of inactivity similar to how the session expires.
I am familiar with how to sign a user out with a few lines of code. How can I make it so that the user is automatically signed out after a specified period of inactivity?
Currently, I have some code in the global.asax
file that programmatically checks when the last request was and compares it to the current time; it then signs the user out if a certain period of time has expired.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Peter Kron 在您的 MSDN 主题中提出了一个答案:
http://social. msdn.microsoft.com/Forums/en-US/Geneva/thread/6b6d51ea-9c15-4744-800b-dd1379b495c3
Peter Kron has proposed an answer in your MSDN thread:
http://social.msdn.microsoft.com/Forums/en-US/Geneva/thread/6b6d51ea-9c15-4744-800b-dd1379b495c3