Hello @harsha vardhini !
I suggest to have a look here
https://learn.microsoft.com/en-us/entra/msal/dotnet/how-to/token-cache-serialization?tabs=aspnetcore
--> Acquire Token Silently: acquireTokenSilently()
is designed to retrieve tokens with no user interaction, and it will automatically use the refresh token
ALSO :
For the middle-tier service to make authenticated requests to the downstream service, it needs to secure an access token from the Microsoft identity platform. It only uses delegated scopes and not application roles. Roles remain attached to the principal (the user) and never to the application operating on the user's behalf. This occurs to prevent the user gaining permission to resources they shouldn't have access to.
https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-on-behalf-of-flow
The expiratiobn time :
Refresh token MaxInactiveTime will be 90 days and MaxAgeMultiFactor will be until revoked.
Token lifetime behavior
You can configure the token lifetime, including:
- Access and ID token lifetimes (minutes) - The lifetime of the OAuth 2.0 bearer token and ID tokens. The default is 60 minutes (1 hour). The minimum (inclusive) is 5 minutes. The maximum (inclusive) is 1,440 minutes (24 hours).
- Refresh token lifetime (days) - The maximum time period before which a refresh token can be used to acquire a new access token, if your application had been granted the
offline_access
scope. The default is 14 days. The minimum (inclusive) is one day. The maximum (inclusive) 90 days. - Refresh token sliding window lifetime - The refresh token sliding window type.
Bounded
indicates that the refresh token can be extended as specify in the Lifetime length (days).No expiry
indicates that the refresh token sliding window lifetime never expires. - Lifetime length (days) - After this time period elapses the user is forced to reauthenticate, irrespective of the validity period of the most recent refresh token acquired by the application. The value must be greater than or equal to the Refresh token lifetime value.
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards