Question

Trying to retrieve files via SharePoint Online (safe.microsoft-sharepoint) always results in an access token expiration on FME server

  • 13 July 2022
  • 1 reply
  • 19 views

Badge

Hi

 

When my published workspace on the FME Server makes a call against Sharepoint (graph.microsoft.com...) in order to download or upload files, it always results into a SharepointRESTAPIException and needs to republish the workspace with a reauthenticated web connection again and again and again in order to make it work:

 

2022-7-12 16:17:49 | Python Exception <SharepointRESTAPIException>: SharepointOnlineConnector: Error making request to https://graph.microsoft.com/v1.0/sites/[TENANT].sharepoint.com,[MYSHAREPOINTSITE] Access token has expired or is not yet valid.

 

This way, an automation is absolutely impossible since manual actions are required.

 

Our admins tell that the registered app on the Azure AD cannot be changed regarding the refresh token timeout:

https://docs.microsoft.com/en-us/azure/active-directory/develop/refresh-tokens#refresh-token-lifetime

 

The request parameters in the web connection definition looks like this:

client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&refresh_token=[REFRESH_TOKEN]&grant_type=refresh_token

 

I actually don't know what has to be done to set up stable SharePoint requests so the token does not expire but reliably gets refreshed.

 

What can we miss here?

The connection works but the refresh token issue is extremely annoying and actually a stopper here.

 

Thanks!


1 reply

Userlevel 1
Badge +6

Hi @fungergis​ ,

 

How often are you running your automation? If you're using the Sharepoint List Reader/Writer, this article goes through a couple ways to setting up the Sharepoint Online web service and Option 2, Connecting to Sharepoint with your own Client ID [Multitenant] may be the steps that you're looking for. If you're using the SharePoint Online web connection from the Microsoft SharePoint package from FME Hub, please see this article.

 

Hope this helps!

-Kezia

 

Reply