Issue with Refresh Token Expiry in Azure AD SPA Application
We have registered our app in Azure AD as a SPA and configured it to issue both Access tokens and ID tokens. Our app is set as "Multitenant," allowing users from any organization directory to access it. We have configured API permissions with scopes including "User.Read", "profile", "openid", "offline_access", "Sites.ReadWrite.All", and "Files.ReadWrite.All".
Our application uses MSAL to handle user authentication and authorization, acquiring access and refresh tokens. We understand that the refresh token has a validity of 24 hours. To ensure smooth operation of our nightly jobs, we need to refresh the refresh token before it expires.
However, we have encountered an issue where, upon using the https://login.microsoftonline.com/common/oauth2/v2.0/token
endpoint with the grant_type=refresh_token
and refresh_token
parameters, the new refresh token we receive does not have a validity period extending beyond the original refresh token's expiration. Instead, it appears to have the same expiration time as the original refresh token.
Could you please provide guidance on how we can obtain a new refresh token with an extended validity period? We are aiming for the new refresh token to be valid for an additional 24 hours from the time of issuance.