Office Add In Single Sign on - Access token Expiry

Dhiluraj V 46 Reputation points
2022-08-05T09:17:33.167+00:00

I have a word addin which uses Office.auth.getAccessToken for authenticating with azure. Does this access token has an expiry defined ? I could not see any expiry key on the response from getAccessToken().

Microsoft 365 and Office | Development | Other
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author
Shweta Mathur 30,471 Reputation points Microsoft Employee Moderator
2022-08-10T10:33:57.987+00:00

Hi @Dhiluraj V ,

Thanks for reaching out.

I understand you are calling Azure AD endpoints to get an access token to add-in's web application.

There are two versions of access tokens provided by Microsoft identity platform based on the endpoint version which we are calling to get the access token: v1.0 and v2.0.
These versions determine the claims that are in the token.

exp claim in the payload specifies the expiry time of the token or after which the JWT must not be accepted for processing in both v1 and v2 version.

229928-image.png

All the access tokens can be decoded using https://jwt.ms to check the value for each claim.

If you are not getting the exp claim in the access token, then access token has not been generated correctly.

Thanks,
Shweta

------------------------------------

Please remember to "Accept Answer" if answer helped you.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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