Skip to main content

Hi all.

I’ve tried to setup a connection to a list of files on a (customer) Sharepoint service without much success.

I’ve read multiple other questions about it here, and some provided useful help (prompt=login), but most does not address my issues.

The customer has created the site, and provided me with tenant and client IDs, and client secret. And he has created an “app” with an approval of my client (FME Form).

First I tried to create a web service, but never got the “Test...” to work. First it erred insisting on getting an approval, but “prompt=login” solved that, but not it errs with a “refresh token” error.

The same happens when I try to create a new web connection using the web service in a SharepointOnlineConnector.

I then saw that there was an alternative use, using FeatureReader with “Microsoft Sharepoint List”, and here I was able to create a web connection using the previous web service unaltered. Sofar it can only access root douments, but the connection works, it seems.

But now (in SharepointOnlineConnector) I can neither select this web connection, nor create a new one based on the original web service.

What gives ?

Cheers, Lars I

One issue I recently found out about, was that it seems that both the FME webservices and Sharepoint itself has changed quite a bit from 2020/2022 until 2024.

So I’ve been forced to focus exclusively on th 2024 implementation in FME.

In 2024 there are two different templates for SharepointOnlineConnector and Sharepoint List reader respectively.

However, our company Office/Sharepoint wiz now questions most of what both of these templates contain, saying that they both promote an outdated way of comunication (using “Sharepoint” instead of “Graph”), so I’m now curious about the templates themselves.

I still can’t connect to any Sharepoint, and I still only have access myself to the FME side of things.


Well, “sleeping” on this problem for a couple of weeks, and then solving it myself !

It seems that the proposed url’s in the Sharepoint webservices are at fault. They need to be updated, Safe!

In an article by Safe itself, they hint at the solution: https://support.safe.com/hc/en-us/articles/25407743885965-Troubleshooting-SharePoint-Web-Connections-and-Services

On page 5 there is a paragraph named “401 unauthorized or failed to obtain refresh token”.

It mentions an updated Microsoft calling regime for desktop programs, which the default proposed url’s does not adhere to.

One needs to remove “client_secret=cCLIENT_SECRET]” from “request format” in both token setups.

I’ve also prepended “code= CODE]” in the second url, but is unsure whether this is needed. But it works with it, so I’m leaving it in there.

And the autorization url can be ended with “prompt=select_account” to prevent having to login more than once.

All this worked for me. Hopefully it’ll also work for you.

Cheers.


Addendum.

If you need to run a workspace using this web service as batch, e.g. in a scheduled task, you also need to remove the prompt for account.

I.e. exchange “prompt=select_account” with “prompt=none” in the authorization url.

You probably also need to reauthenticate the web connection (right click on it).

I’m not entirely sure how long this authentication works. I’ll see how it goes for now.


Reply