function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kevin BreanachKevin Breanach 

Can't get Files Connect working with SharePoint Online - debugging help

I've followed all of the documentation steps, starting from https://help.salesforce.com/apex/HTViewHelpDoc?id=admin_files_connect_overview.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=admin_files_connect_overview.htm&language=en_US) but when I test the authentication (either via my username>My Settings>Personal>Authentication (etc) or Setup>Develop>External Data Sources) the following happens:
1. I get redirected to the correct SharePoint site and asked if I want to trust CRM. I click 'Trust it'.
2. I get a SalesForce error

There was a problem with your authentication attempt. Please try again. If you continue to encounter problems, contact your administrator.

Is there any way I can debug this further? I've not been able to connect to SharePoint with the Online Mnaagement PowerShell plugin (as suggested). Are there any SalesForce logs I can check?

Any suggestions gladly appreciated.

Best Answer chosen by Kevin Breanach
Eric BowdenEric Bowden
Hi Kevin, in case you are still facing this issue...

I've seen the error you're describing when I didn't copy the Call Back URL from the Auth Provider in SharePoint into the Redirect URI input which appears on the appregnew.aspx page in SharePoint.  

Also, you cannot change the Redirect URI on the appinv.aspx page in SharePoint.  The field does appear on that page for information, but it is read only.  You can only update the Permission Request XML on the appinv.aspx page.  It's a gotcha that most of us have stumbled on.

Last, I've had issues copy/paste the Client Id and Client Secrets where I picked up some white spaces.  The appinv.aspx page, as of last time I tried it, is not kind enough to trim white spaces from the client id/client secret.

I usually remove my auth provider and start over if I see this error and it is resolved.

Happy to help if you are still having the issue.

All Answers

Eric BowdenEric Bowden
Hi Kevin, in case you are still facing this issue...

I've seen the error you're describing when I didn't copy the Call Back URL from the Auth Provider in SharePoint into the Redirect URI input which appears on the appregnew.aspx page in SharePoint.  

Also, you cannot change the Redirect URI on the appinv.aspx page in SharePoint.  The field does appear on that page for information, but it is read only.  You can only update the Permission Request XML on the appinv.aspx page.  It's a gotcha that most of us have stumbled on.

Last, I've had issues copy/paste the Client Id and Client Secrets where I picked up some white spaces.  The appinv.aspx page, as of last time I tried it, is not kind enough to trim white spaces from the client id/client secret.

I usually remove my auth provider and start over if I see this error and it is resolved.

Happy to help if you are still having the issue.
This was selected as the best answer
Kevin BreanachKevin Breanach

Eric, you are my saviour.

I would have sworn blind that I already did everything as you'd suggested but I went through it again with your advice in mind and it worked! Now I have the problem that my SharePoint site doesn't appear as a collection in 'Files'. My profile orifginally didn't have the 'Files Connect Cloud' admin permission but after changing that it's still not visible.

Any ideas?

Eric BowdenEric Bowden
Did you authenticate the external data source?

When starting out, I recommend that you configure the external data source Identity Type = Named Principal and check the box labled Start Authentication Flow on Save.  With this setting in place, it means that Files Connect will access SharePoint using your user credentials, which may not be what you want, but it is the easiest way to get started.  Once everything is working, you can set the Identity Type back to User Principal, but you have to ask your users to go through the steps at this link https://help.salesforce.com/HTViewHelpDoc?id=collab_files_connect_cred.htm.

Also, my experience is that Files Connect uses SharePoint search to retrive the listing of files.  You'll need to be sure that your target site contains at least one file and that SharePoint search has had time to index it.