Skip to main content

Create an App in SharePoint and Connect via ACS OAuth

If possible it is preferred to create an App in Azure AD to connect via OAuth as it is easier to manage when the Client Secret expires. However if you cannot access your organizations Azure AD then this will be the best method to use.

The summary of the flow you need to follow can be found below:

1) Create the App in SharePoint at the following link:https://{yourdoman}.sharepoint.com/_layouts/15/appregnew.aspx
2) Give the App permission in SharePoint at this link: https://{yourdomain}.sharepoint.com/_layouts/15/appinv.aspx
3) Connect in Data Sync using the credentials you gathered in the first step.

info

To view a list of registered apps in your SharePoint site you can do so at https://{yourdomain}.sharepoint.com/_layouts/15/appprincipals.aspx

1. Create the App in SharePoint

caution

You will need to be a Site Collection Administrator to do this. If you do not have permission please contact your Site Administrator to create this for you.

Go to your SharePoint site and navigate to the application page. This can be found at the following link: https://{yourdoman}.sharepoint.com/_layouts/15/appregnew.aspx

Then click onto the generate buttons to create a Client ID and Client Secret. Please make sure to make a note of these values as you will need to use them to set the permissions and to create the connection in Data Sync.

Enter in a title for your App and then enter a domain and redirect URI. Click Create to create the app in SharePoint.

Register App

When you have clicked create you will be given a confirmation page with all of your app details. If you haven't already done so, please make a note of these now as we will need to use them again later.

2. Set the Permission Level

We now need to set the permission levels for the app, 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 click onto the Lookup button to return the app details. 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>

Define App Permissions

Once you are done click Create to set the permissions.

info

To learn more about these permissions please see the Microsoft website here .

You will be prompted in the browser to trust the app you have just created. Click the Trust It button to finish creating the app.

Trust App

3. Connect in Data Sync

To connect in Data Sync open the connection window and go to the SharePoint Online provider.

Enter in the URL to your base url of your SharePoint site i.e. http://<sharepointurl>/<site1>/<site2> and then select ACS OAuth App Connection from the drop down list.

Enter in your Client ID and Client Secret from your SharePoint App and click Authorise Connection to validate the details and get a refresh token.

SharePoint Connection

If the details are correct then you will now be able to choose the list or library you wish to connect to from the List Name dropdown menu. You can also set the delete behaviour if you want this to recycle rather than delete items.

Now connect to SharePoint by clicking Connect & Create Library Connection. This will save the connection to your connection library.

Select List

Enter in a name for the connection and click OK. You are now connected to your SharePoint site and can configure your Data Sync project as you need to.

Please note that you can connect to all the list and libraries found within that SharePoint site from the Connection Library window, so you do not need to re-create the connection each time.