Before Sync & Save can connect to a site hosted at sharepoint.com, you must register Sync & Save with your SharePoint site.
Note: You must be the site administrator to perform these steps.
- Log in to your sharepoint.com site.
- Change the URL to https://yourdomain.sharepoint.com/_layouts/15/appregnew.aspx (replace yourdomain with the correct value for your sharepoint site).
- Click Generate next to Client Id and Client Secret. Make sure to copy the generated values and save them so they can be used later when setting up Sync & Save.
- Set the Title to "Sync & Save".
- Set App Domain to "localhost".
- Set Redirect URI to "https://localhost/default.aspx".
- Click Create.
- Change the URL to https://yourdomain.sharepoint.com/_layouts/15/appinv.aspx (replace yourdomain with the correct value for your sharepoint site).
- Paste the Client Id generated in step 3 into the App Id field and click Lookup.
- The Title, App Domain and Redirect URL should all populate the the values you entered previously.
- Paste one of the following XML snippets into the Permission Request XML box. Each snippet requests a different set of permissions:
- Access to the complete site collection
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests> - Access to the current site or subsite
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests> - Access to a specific list
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl" />
</AppPermissionRequests>
Read more about possible permission sets here: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint#types-of-add-in-permissions-and-permission-scopes
- Access to the complete site collection
- Click Create.
- Click Trust It.
The next step is to configure Sync & Save to connect to SharePoint:
- In Sync & Save select Tools > Options > Accounts > SharePoint.
- Change the Authorization Type dropdown to Access Token.
- Set the Site Url to https://yourdomain.sharepoint.com (replace yourdomain with the correct value for your sharepoint site).
- Paste the Client Id you generated in SharePoint in the Client Id field.
- Paste the Client Secret you generated in SharePoint in the Client Secret field.
- Set the File Upload Method to ExecuteQuery.
- Click Test to make sure you can connect to your SharePoint site.
- Click OK.
Note: Client secrets expire after one year. There are two ways to generate a new Client secret:
- Follow the instructions in this article again, and register a new Client id and a new Client secret. Sometimes there is a delay of several hours after a new Client id and Client secret are created before they become available in SharePoint. After registering a new Client id and Client secret, use the Test button in the Options dialog to test the connection until it succeeds.
- Follow these instructions to generate a new Client secret without changing the Client id: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/replace-an-expiring-client-secret-in-a-sharepoint-add-in
Note that once you have a new Client secret, you do not need to follow the instructions in the section "Update the remote web application in Visual Studio to use the new secret." Instead, just update the Client secret in Sync & Save with the new value.
For more details on connecting to SharePoint, see the instructions under Register by using AppRegNew.aspx.
Note: If two factor authentication is enabled, the connection attempt will fail with a 401 error.