Use the following guide to learn how to connect to SharePoint Online using OAuth Authentication. Available from version 3.0.1276.
You may need to use OAuth Authentication if Legacy Authentication has been disabled on your Office 365 tenant.
https://{yourdomain}.sharepoint.com/_layouts/15/appinv.aspx
To view a list of registered apps in your SharePoint site you can do so at
https://{yourdomain}.sharepoint.com/_layouts/15/appprincipals.aspx
Login to your Azure Portal and navigate to Azure AD
> App Registrations
> New Registration
to create your connection.
Now enter in a name for your application and choose the supported account types, for this we only need access to those within our organization so we have selected Accounts in this organizational directory only
.
Once you're done click onto Register
to create the app.
You'll now be given an overview of your app credentials (Client ID and Tenant ID).
Now you need to create a client secret. To do this go to Certificates & Secrets
and click onto New client secret
. Type in a description and set an expiry for the secret. Once you are done click Add
.
You now need to copy the client secret value to use in Data Sync later on. Please make a note of this value as you will not be able to view it again. If you loose it you will need to create a new client secret.
Now we need to set the permission levels for the app in SharePoint, do this by navigating to the application page at: https://{yourdomain}.sharepoint.com/_layouts/15/appinv.aspx
Enter in the Client ID
you generated earlier into the App ID field and lookup the Application. This will enter in the details you entered earlier into the other fields.
We now need to add the XML permission statement to give full control to the application. The XML we use to do this is:
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>
Once you are done click Create
to set the permissions.
To learn more about these permissions please see the Microsoft website here .
To connect in Data Sync open the connection window and go to SharePoint Online provider.
Enter in the URL to your base url of your SharePoint site i.e. http://<sharepointurl>/<site1>/<site2>
and click on the ellipsis (...
) in the OAuth2 field to open the OAuth credentials window.
Enter in your Client ID and Client Secret and click OK
to save the credentials.
Choose the list or library you wish to connect to from the ListName dropdown menu and then connect by clicking Connect & Create Library Connection
to save the connection to your connection library. Otherwise simply click Connect
.
You're now connected to your SharePoint site and can configure your Data Sync project as you need to.
If your client secret has expired or you have lost it then you can fix this by creating a new one. Log into your Azure Portal, open Azure AD, click onto App Registrations and then open your SharePoint App. Now go to Certificates & Secrets and click onto New Client Secret. Type in a name, set the expiry length and then click Save. You need to copy the value that has been generated and update your client secret in Data Sync.
It is worth saving the client secret value as you will not be able to access it later.
You can then delete the old client secret.