I'm trying to connect to our SharePoint Online environment to be able to work with lists. In FME Workbench (2021.1) I used the "Microsoft SharePoint Online (template) to create a new web service. When I try to test it I'm getting an error: "Authorization and token retrieval was successful but refreshing the token using 'Refresh Token Parameters' failed. Error: HTTP/1.1 401 Unauthorized".
My redirect uri is set to https://localhost
My Auth parameters url is:
https://login.microsoftonline.com/{mytenantID}/oauth2/v2.0/authorize?scope=https://{mytenant}.sharepoint.com/.default offline_access&response_type=code&prompt=consent
Retrieve Token Parameters url:
https://login.microsoftonline.com/{mytenantID}/oauth2/v2.0/token
refresh token Parameters url:
https://login.microsoftonline.com/{mytenantID}/oauth2/v2.0/token
request format (default carried over from template):
client_id=dCLIENT_ID]&refresh_token=nREFRESH_TOKEN]&grant_type=refresh_token
In Azure, my app has Graph permissions added for Sites.ReadWrite.All and User.Read as well as SharePoint permissions for AllSites.Manage and MyFiles.Write.
I'm at a loss at what I've got wrong or missing here. I've tried setting up the SharePoint Online (safe.microsoft-sharepoint) service and it works. I can add a SharePoint connector to my workspace and am able to connect to my tenant and its libraries with it. So, I seem to have the right client ID/secret/tenant information. Any suggestions/insight would be appreciated.
Thank you.