Integrating the product and SharePoint Online with minimum permissions

This topic outlines the process of configuring the product and SharePoint Online with minimum permissions by registering a custom Enterprise Application in your product tenant. See Understanding Resource Specific Consent for Microsoft Graph and SharePoint Online for more information.

  • We recommend upgrading to Nintex K2 Five (5.6) or later to increase security for the client secret as field masking was not added in previous versions.

  • Only the update config script must be run on the K2 Server. This is necessary as the script modifies local resources. If you are running the script on a secondary device, the information required for Microsoft Entra ID (previously known as Azure Active Directory) such as client secret and trust certificate must be manually uploaded.

Prerequisites

The following prerequisites are required before starting with the configuration

  1. Tenant ID from Microsoft Entra ID (Azure Active Directory)
  2. Install Powershell 7 on the K2 Server
  3. When you run the Nintex K2 for SharePoint Registration Wizard or the Nintex K2 for SharePoint Activation Wizard, a resourceId error may occur. The fix is available in: An error occurs in K2 for SharePoint Registration and Activation Wizards

  4. Ensure the domain that the product site is running on is added as a validated custom domain in Microsoft Entra ID. The product needs the application identifiers set to match the base URLs. Microsoft does not allow direct editing of these URLs in the app manifest or via the API. A restriction was added that only URIs that are validated on the tenant can be used. See Add your custom domain for details on how to add a custom domain.

Permissions

The following roles and permissions apply in Microsoft Entra ID and SharePoint Online.

Action Role/Permission required to perform the action
Step 1  
Create SharePoint Online application Application Administrator Role
Setup custom domain Domain Name Administrator
Grant admin consent Global Administrator or Privileged Role Administrator
Step 2  
Grant-PnPAzureADAppSitePermission Site Collection Administrator
Grant-PnPAzureADAppSitePermission Site Owner
Step 3  
Run K2 Registration Wizard Global Administrator
Run K2 Activate Site Wizard Site Collection Administrator
K2 server file system changes K2 Administrator

 

Revoke permissions for site collections

Permissions can be revoked for site collections by following the steps in the following link:

Revoke-PnPAzureADAppSitePermission

For example:

Copy
PowerShell 7.3.8 
                PS C:\> Connect-PnPOnline -Url https://m365x67600804.sharepoint.com/sites/Main -Interactive; 
                PS C:\> Get-PnPAzureADAppSitePermission 
                Id : aTowaS50fG1zLnNwLmV4dHxmOGU1ZDFhZC1mMmFkLTRlZjktYjY2Zi0yMDY2OWQ5MDNhODRANWJlNDc5MzMtZmJlZS00NTQ0LTlhOWItNzJiMzc2YjQyMThh 
                Roles : {fullcontrol} 
                Apps : {SitesResourceSpecific, f8e5d1ad-f2ad-4ef9-b66f-20669d903a84} 
                PS C:\> Revoke-PnPAzureADAppSitePermission -PermissionId aTowaS50fG1zLnNwLmV4dHxmOGU1ZDFhZC1mMmFkLTRlZjktYjY2Zi0yMDY2OWQ5MDNhODRANWJlNDc5MzMtZmJlZS00NTQ0LTlhOWItNzJiMzc2YjQyMThh 
                Confirm 
                Are you sure you want to revoke the permissions? 
                [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y 
                PS C:\> Get-PnPAzureADAppSitePermission 
            PS C:\>