什么值(Cookie、SessionID、变量)最能代表 WIF 会话?
我想跟踪用户从登录我的网站到注销的登录会话。
我应该使用预先存在的 cookie 或变量吗?我想过使用 ASP.NET sessionID,但在 StackOverflow 上读到这些数字可能会改变。
我会保存自己的会话 cookie,但我不想做一些可以通过其他方式更有效地完成的事情。我正在使用 Windows Identity Foundation (WIF) 来处理我的身份验证层。
我在 fiddler 中看到的唯一 cookie 是 FedAuth cookie,因此我认为我可能能够从中获取一些有价值的信息,但我不知道在 WIF 框架中的何处/如何访问此类信息。
I want to track a user's logon session from the time they login to my site, to the time they logoff.
Is there a pre-existing cookie I should use, or variable? I thought of using ASP.NET sessionIDs but read on StackOverflow that these numbers may change.
I would save my own Session cookie, but I don't want to do something that could be done more efficiently another way. I'm using Windows Identity Foundation (WIF) to handle my authentication layer.
The only cookie I see in fiddler is a FedAuth cookie so I assume that I might be able to derive some valuable information from it, but I don't know where / how in the WIF framework to gain access to such information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WIF 提供了一系列您可以订阅的活动。请参阅:
http://msdn.microsoft.com/ en-us/library/microsoft.identitymodel.web.wsfederationauthenticationmodule_members.aspx
http://msdn.microsoft.com/en-us/library /microsoft.identitymodel.web.sessionauthenticationmodule_members.aspx
WIF gives a bunch of events you can subscribe to. See these:
http://msdn.microsoft.com/en-us/library/microsoft.identitymodel.web.wsfederationauthenticationmodule_members.aspx
http://msdn.microsoft.com/en-us/library/microsoft.identitymodel.web.sessionauthenticationmodule_members.aspx
您可以通过配置控制某些 cookie 特征 - 隐藏的宝石:WIF 配置架构。特别要注意 cookieHandler 部分和
就WIF而言,Tokens.SessionSecurityTokenCookieSerializer中有一个Deserialize,IdentityModel.Web中有一个CookieHandler(删除/读取/写入)。
You can control some of the cookie characteristic via the config - A Hidden Gem: The WIF Config Schema. In particular, note the cookieHandler section and
In terms of WIF, there is a Deserialize in Tokens.SessionSecurityTokenCookieSerializer and a CookieHandler (Delete / Read / Write) in IdentityModel.Web.