-
Notifications
You must be signed in to change notification settings - Fork 148
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] Expose refreshOn in IAuthenticationResult #822
Comments
Hi @g2vinay - not understanding how "refreshOn" is useful on AuthenticationResult object? We can of course add it in case ppl want to log this value for their own telemetry purposes. But does it have any functional value? RefreshOn is for MSAL to perform background token refresh. |
Yeah we have a cache layer in azure-core, that defaults to refresh offset of 5 minutes. |
Based on the discussion with @Avery-Dunn To further highlight, |
The value in MSAL.NET is read-only and it is only exposed for telemetry and monitoring purposes. MSALs will handle all "proactive" refreshes internally. This is not the responsibility of Azure SDK. The way it works is:
Some details might be a bit different in MSAL4j, e.g. the refresh might not be on background thread but on the same thread as the request. Can you please detail your scenario better? I do not see why this is important and no customer / app developer requested this before. |
Today, Azure SDK has its Token Cache implementation which defaults to a refresh offset of 5 minutes. Further, the default refresh offset of 5 minutes in Azure SDK token cache is creating reliability issues for our enterprise customers and the ask is for Azure SDK to use the refresh on info in their cache implementation to invoke the token credential at the given refresh on time. |
I always wondered why Azure SDK would need to build its own token cache layer when MSAL already has one. Now that you mentioned "[some TokenCredential] may not be using Msal", so, that makes sense. Out of curiosity, what are those non-MSAL TokenCredentials? Managed Identity (MI) is probably one of them, but Azure SDK will soon move to use MSAL's MI (thus MSAL's token cache for it).
Just want to make sure we are using same terminology here. The If Azure SDK chooses to use MSAL does not expect downstream callers to handle |
@Avery-Dunn |
Released as part of 1.16.0, #829 |
MSAL client type
Public, Confidential, Managed identity
Problem Statement
The refreshOn property of the token isn't returned as part of IAuthenticationResult.
It prevents users from accessing and honoring this property.
This feature is required for :
Today, Azure SDK has its Token Cache implementation which defaults to a refresh offset of 5 minutes.
This cache caters to all implementations of TokenCredential which may or may not be using Msal.
So, today the refresh offset of 5 minutes overrides the Msal's refresh_on , as the refresh_on is not available at Azure SDK cache layer.
We need the refresh_on information to correctly invoke the TokenCredential at its desired refresh_on time.
Further, the default refresh offset of 5 minutes in Azure SDK token cache is creating reliability issues for our enterprise customers and the ask is for Azure SDK to use the refresh on info in their cache implementation to invoke the token credential at the given refresh on time.
Proposed solution
Expose the refreshOn property of the token similar to the expiry time.
Alternatives
No response
The text was updated successfully, but these errors were encountered: