Why access token is expired?

Utkarsh Prashar 40 Reputation points
2024-03-27T03:44:11.8066667+00:00

Hello can anyone let me know why and how my access token is expired after couple of days i get this error.

{"error":{"code":"InvalidAuthenticationToken","message":"Lifetime validation failed, the token is expired.","innerError":{"date":"2024-03-27T03:42:52","request-id":"bd293dcf-1682-4af6-b1cf-1a2e229c7f96","client-request-id":"bd293dcf-1682-4af6-b1cf-1a2e229c7f96"}}}

One more thing i want to add filter of type = "occurence" in
uri - https://graph.microsoft.com/v1.0/me/calendarView

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

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2024-03-27T06:29:08.1066667+00:00

    Hi @Utkarsh Prashar

    Access tokens expire for security reasons. Azure AD access tokens have a default validity period (usually 1 hour). Once expired, you need to re-authenticate to obtain a new token. Doing this prevents the same token from being used for an extended period of time, thereby reducing the risk of misappropriation.

    You can also use refresh tokens to renew new access tokens. Refresh tokens allow you to obtain new access tokens without user interaction to avoid frequent user login authentication. Refresh tokens have a lifespan 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.


0 additional answers

Sort by: Most helpful

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.