(Example) How to Get the Access Token Credentials from SharePoint for Microsoft 365
Background and Setup
Other Examples
- (External) AgilePoint Intelligent Process Automation App for SharePoint Online
- (Example) Create a SharePoint Access Token
- Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.
Prerequisites
- 2 self-signed certificates in PFX and CER format.
- PFX - The file must be in .pfx format and requires a password.
- CER - The file must be in .cer format.
For help creating a self-signed certificate, contact AgilePoint Professional Services.
- These access rights
for AgilePoint NX Portal:
- Enable Manage Center Access
- Add, Remove, And Modify Global Application Resources
For more information, refer to:
- A SharePoint site in SharePoint for Microsoft 365.
- Credentials with one of these permissions for Microsoft Azure:
- microsoft.directory/applications/createAsOwner
- microsoft.directory/applications/create
- One of these Microsoft 365 account types:
- Microsoft 365 Business
- Microsoft 365 Enterprise
Good to Know
- This example shows how to create an access token for SharePoint for Microsoft 365. This topic does not apply to SharePoint on-premises.
- This example shows how to create the SharePoint access token with OAuth 2.0 Authentication using the Azure AD App Only option.
- OAuth 2.0 access tokens require a 2-way exchange of credentials between AgilePoint NX and the external service. This means that you must get the credentials from the third-party service to paste in the AgilePoint NX access token, and get the redirect URI from AgilePoint NX to paste in the external service. This requires you to open both the AgilePoint NX access token and the third-party service at the same time, so you can copy and paste from one screen to the other.
This topic shows the suggested procedure for SharePoint. The exact procedure for your access token depends on whether you already have a connection (usually called an app) configured in the external service.
- This topic gives one example. The procedure may vary depending on your configuration and account settings in the third-party service.
Step 1: Start Creating an Access Token in AgilePoint NX
First, create a new access token in AgilePoint NX for SharePoint.
How to Start
- There is more than one way to create an access token.
For more information, refer to Access Token for SharePoint.
Procedure
- In AgilePoint NX, open the access token configuration screen for SharePoint.
Do not configure the access token credentials.
Keep the access token configuration screen open in AgilePoint NX, but do not save it.
Step 2: Create an App for SharePoint
Step 3: Copy the Client ID And Tenant ID from the SharePoint App
Next, copy the client ID and tenant ID from the SharePoint App in Microsoft Azure to your AgilePoint NX access token.
Procedure
- In Microsoft Azure, to copy the client ID, on the Employee Onboarding App screen, hover your cursor over the Application (client) ID field, and click Copy to clipboard.
- In AgilePoint NX, on the SharePoint Access Token screen, in the Client ID field, paste the Application (client) ID value from Microsoft Azure.
- In Microsoft Azure, to copy the Tenant Name, hover your cursor over the Directory (tenant) ID field, and click Copy to clipboard.
- In AgilePoint NX, on the SharePoint Access Token screen, in the Tenant Name field, paste the Directory (Tenant) ID value from Microsoft Azure.
Step 4: Configure the Certificate for the SharePoint App
Next, configure the certificate for the SharePoint app.
Prerequisites
- A self-signed certificate in .cer format.
For help creating a self-signed certificate, contact AgilePoint Professional Services.
Procedure
- On the Employee Onboarding App screen, click Manage > Certificates & secrets.
- On the Certificates & secrets screen, click Certificates.
- On the Certificates tab, click Upload certificate.
- On the Upload Certificate screen, in the Upload a certificate (public key) with one of the following file types: field, click Select a file.
- Select a certificate from the local machine.
- Click Add.
The Certificates & secrets screen shows the certificate.
Step 5: Configure the Permissions for the SharePoint App
Next, configure the API permissions for your SharePoint app.
Procedure
- On the Employee Onboarding App screen, in the Manage section, click API permissions.
- On the API permissions screen, in the Configured permissions section, click Add a permission.
- On the Request API permissions screen, in the Microsoft APIs tab, click SharePoint.
- On the SharePoint section, in the What type of permissions does your application require? field, click Application Permissions.
- In the Select permissions section, select Sites.FullControl.All.
- Click Add Permissions.
- On the API permissions screen, click Grant admin consent for AgilePoint.
- Click Yes.
The API permissions screen shows the SharePoint permission.
Step 6: Configure the Site Collection URL from the SharePoint Site
Next, configure the SharePoint site URL from SharePoint to your AgilePoint NX access token.
How to Start
- In one web browser tab, in SharePoint for Microsoft 365, open the SharePoint site.
- In a different web browser tab, in AgilePoint NX, open the SharePoint access token configuration screen.
Procedure
- In SharePoint for Microsoft 365, on the SharePoint site, copy the URL for the SharePoint site.
This is an example value. In a production environment, copy the actual Site Collection URL from SharePoint site.
- In AgilePoint NX, on the SharePoint Access Token screen, in the Site Collection URL field, paste the URL value from SharePoint for Microsoft 365.