Issue with Refresh Token Expiry in Azure AD SPA Application

Yash 0 Reputation points
2024-08-05T09:49:27.5433333+00:00

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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,218 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,065 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.