-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] [L] TokenCacheNotificationArgs should expose the token expiry so that cache can optimize eviction (client_credentials only) #2486
Comments
Requires a bit more spec: The problem is that the cache corresponding to an incoming token into a web app contains several OBO tokens. What should be the expiry? How do the OBO token expire vs the incoming token ? (for which MSAL.NET does not know the expiry) |
Needs more spec and a better understanding of OBO being able to refresh using RT or not. |
After doing an investigation it appears that given the access tokens can be refreshed for 90d, this does not make sense to expose an expiry. |
@bgavrilMS: I've improved a bit the spec. do you want to check? |
Lgtm @jmprieur, thx for providing clarity. The return type should be nullable DateTimeOffset?, Since in most cases we will not set this. Also, this property will only be set on OnAfterAccess callbacks. |
@bgavrilMS : yes it should be nullable, but I don't think we have nullable in MSAL.NET? |
We have nullable structs since C# 3.0 or smth. The "nullable reference types" feature is C# 8.0 only, so MSAL can't use that. Another way of achieving this is to set the expiry to max, via |
released in 4.34.0 |
Is your feature request related to a problem? Please describe.
In token cache serializers for confidential client applications:
Describe the solution you'd like
In
TokenCacheNotificationArgs
add a new property of typeSuggestedCacheExpiry
, and of the same type as the expiry in the token cache times (I suppose this is DateTimeOffset, but this needs to be checked).This property will be computed by items.Max(item => item.ExpiresOnUnixTimestamp), and then convert that to a UtcDateTime.
The text was updated successfully, but these errors were encountered: