O365 token is expiring after every 3599 sec i.e. 1 Hr and does not get refresh automatically.

anandwakode
Tera Contributor

We have setup integration between O365 and Servicenow, in which we are integrating Policy with Share Drive. We have done the complete setup, installed plugins (Multi-Provider Document Services Framework

) & (Microsoft OneDrive Spoke for Document Service Framework), given required roles (mp_document_user), created connections and credentials for Azure AD and One Drive, and got a token.
When we completed the setup and got the token, the integration was working for only one hour(3599 sec), because the access token is only available for 3599 sec i.e. 1 hour. That means if we want to integrate it again we need to get the token again every time manually, by clicking on ‘Get OAuth Token’ related link OAuth Credential record. 

We need a permanent solution to refresh the token automatically.

3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @anandwakode 

 

https://learn.microsoft.com/en-ie/answers/questions/2245814/my-customers-token-expiration-is-set-to-...

 

Have a look:

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2132135

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron

@anandwakode 

it's always recommended to hit the OAuth endpoint during each API call to get the access token

with this in same hour you get same access token and when the API call runs in next hour you get new access token

So with this you need not worry on getting the access token

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@anandwakode 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader