problem with access token for Microsoft Graph Explorer, it changes every 24 hours

Alla Brusova 0 Reputation points
2023-08-09T13:00:25.5033333+00:00

Hi, I'm having an issue with the access token for Microsoft Graph Explorer. It changes every 24 hours. How can I dynamically obtain the access token for Graph Explorer?

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 Reputation points
    2023-08-10T10:46:48.5133333+00:00

    Hi @Alla Brusova

    I do not recommend that you use the access token in Graph Explorer in production, you should create your own application in Azure AD for easy management.

    The default lifetime of an access token is 1 hour, and the lifetime of an access token can be extended up to 24 hours by creating a token lifetime policy. After 24 hours you will have to re-authenticate to obtain a new access token.

    However, you can also roll over a new access token with a refresh token to avoid sending a new authentication request. Refresh tokens have a lifetime of up to 90 days.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


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.