Set Up SharePoint Modern Authentication

  • Updated

Please note that Microsoft will not support SharePoint Add-in for new tenants starting in November of 2024. Please review this article for other options.

 

Modern authentication setup is restricted to the tenant admin, who must also be the SharePoint site collection administrator for the SharePoint site being in use. This document specifically pertains to the Tabular Data and SharePoint integrations.

If the integration is for Project Online or OneAnalytics integrations, please go to the Project Online Modern Authentication page.

Important

The user setting up Modern Authentication must be a Global Admin (Tenant Admin) as well as the Site Collection Admin.

Navigate to your SharePoint URL

  1. https://{OrganizationName}.sharepoint.com/sites/{SiteName} 

SharePoint URL.png

Register a SharePoint add-in (app)

  1.  Navigate to: {SharePointURL}/_layouts/15/appregnew.aspx
  2. Click on Generate for both Client Id and Client Secret.
  3. Give the add-in app a unique Title.
  4. Enter the App Domain: my.oneconnect.ai (or https://eu.oneconnect.ai for European customers utilizing eu.oneplan.ai)
  5. Enter the Redirect URL: https://my.oneconnect.ai (or https://eu.oneconnect.ai for European customers utilizing eu.oneplan.ai)
  6. Click Create. Save the generated Client Id, Client Secret, and Title for future use.

Note

The client id and client secret are linked to individual OneDrive URLs.

SharePoint Generate Id and Secret.png

Grant API Permissions

  1. Navigate to {SharePointURL}/_layouts/15/AppInv.aspx.
  2. Enter the Client ID from step 2.e into the App Id text field and click Generate. This should populate the Title, App Domain, and Redirect URL fields. Please confirm that all fields were entered correctly.
  3. For the Permission Request XML, enter the following code to grant permissions, then click Create, then Trust It:
<AppPermissionRequests
AllowAppOnlyPolicy="true">
<AppPermissionRequest
Scope="http://sharepoint/content/sitecollection"
Right="FullControl"/>
<AppPermissionRequest
Scope="http://sharepoint/content/sitecollection/web"
Right="FullControl"/>
</AppPermissionRequests>

Note

The XML code will grant two full control permissions on a site collection control on the site. To view the complete list of available scopes, please view the Available scopes and permissions, and restrictions on Office Store App Permissions.

(Optional) Confirm Permissions

  1. Navigate to {SharePointURL}/_layouts/15/appprincipals.aspx
  2. Confirm that the SharePoint Title is available in the list of add-in permissions.

Handling 401 Unauthorized Error

If this message appears when testing the connector or when viewing the field mappings for the integration, please follow the remaining steps:

  1. Navigate to the SharePoint site, click on the waffle icon, then select Admin. This will take you to the Microsoft 365 Admin Center.
  2. In the Microsoft 365 Admin Center, go to SharePoint (hamburger icon in the top left, click Show All, select SharePoint). This URL will be called the SharePointAdminURL.
  3. Open Windows PowerShell as an administrator, and enter the following commands:
    1. Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
    2. Install-Module-Name Microsoft.Online.SharePoint.PowerShell
      1. Note: If this is your first time using Windows PowerShell, you may encounter two notifications. The first notification will prompt 'NuGet Provider is required to continue.' Please read the notification and type 'Y', then press Enter to proceed. The second notification will say ‘Untrusted repository’. Please read the notification and type ‘Y’, then press Enter to proceed.
    3. Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
    4. Update-Module -Name Microsoft.Online.SharePoint.PowerShell
    5. Connect-SPOService -Url [SharePointAdminURL] -Credential [AdminUsername]
      1. Replace [SharePointAdminURL] with the full SharePointAdminURL from 5b without the brackets (e.g., https://{OrganizationName}-admin.sharepoint.com). Replace the [AdminUsername] with the Global Administrator username you are using to grant these permissions, also without brackets.
    6. Set-SPOTenant -DisableCustomAppAuthentication $true
    7. Set-SPOTenant -DisableCustomAppAuthentication $false

Once all the commands have been entered successfully, close PowerShell, and wait ~15 minutes to confirm the error in OneConnect no longer appears when the page is refreshed. For the official Microsoft documentation on the Windows PowerShell instructions: https://docs.microsoft.com/en us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request