How is the expiryTime supposed to be used with SessionSecurityTokenCache.AddOrUpdate()?

风格不统一 提交于 2020-01-15 03:33:10

问题


I'm writing a custom implementation of SessionSecurityTokenCache and I'm somewhat confused as to what the purpose of expiryTime is in the AddOrUpdate method.

As far as I can tell, the default implementation for SessionSecurityTokenCache used by WIF is the internal class MruSessionSecurityTokenCache (mentioned here). In its implementation, expiryTime is completely ignored.

Also, I notice while debugging that the value that gets passed in to AddOrUpdate appears to always be token.ValidTo plus 5 minutes, so there is some intent to use this value somehow.

A few questions:

  • What is the intended strategy for this value?
    • Occasional cache cleanup?
    • Should the Get() and GetAll() methods on SessionSecurityTokenCache be filtering out expired tokens?
  • In any of these cases, why not just use SessionSecurityToken.ValidTo (or some offset therefrom)?

来源:https://stackoverflow.com/questions/16122332/how-is-the-expirytime-supposed-to-be-used-with-sessionsecuritytokencache-addorup

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