Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Graph API Refresh Token Expired

I have a web application integrated to Office 365 using Microsoft graph API. I have using the application for more than a year now. Lately I have been receiving an error stating the refresh token has expired due to inactivity hence I am not able to update that users subscription by 3 days.

Now whenever an email hits the users inbox there is an exception in the listen state.

below is the error message

Error validating credentials. AADSTS70008: The refresh token has expired due to inactivity. The token was issued on 2017-02-16T19:08:12.3388232Z and was inactive for 90.00:00:00.

snippet of the error message

Please help on how to fix this error

like image 663
Alvindra Dutt Avatar asked May 21 '17 20:05

Alvindra Dutt


1 Answers

Check out this document on default and configurable token lifetimes.

In general, the default lifetime of a refresh token is 14 days, and that can be renewed for new access + refresh token pairs for up to 90 days. After 90 days, with the default configuration, a user will have to interactively sign into your application again.

I believe the error you are seeing is a result of this "Refresh Token Max Age". You have the ability to configure this setting so that it will never expire, but the safer practice here would be to catch this error, and have the user sign-in again.

like image 114
Shawn Tabrizi Avatar answered Nov 18 '22 03:11

Shawn Tabrizi