Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Configure Microsoft SharePoint Online connection record

Integrate your ServiceNow instance with the Microsoft SharePoint Online by setting up the Microsoft SharePoint Online and a connection record.

Before you begin

  • Request Integration Hub subscription
  • Activate Microsoft SharePoint Online Spoke
  • Create an OAuth application on Microsoft Azure portal.
  • Access to Microsoft Azure portal
  • Role required: admin

Generate certificate for Windows

Generate a digital certificate file in the .cer format to upload it to Microsoft Azure.

Before you begin

Role required: admin

Procedure

  1. Navigate to https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread#setting-up-an-azure-ad-app-for-app-only-access.

  2. Execute the PowerShell script.

    The script generates two files with .PFX and .CER extensions.

    Note: Store or remember the password that is used to encrypt private key to generate the .PFX file and .CER files.

  3. Use the .PFX file to create a Java Key Store (JKS) file.

    Note: Store or remember the password that is used to generate the .JKS file from the .PFX file.

Generate self-signed certificate for Mac

Generate a digital certificate file in the .cer format to upload it to Microsoft Azure.

Before you begin

Role required: admin

Procedure

  1. Open the terminal on your Mac machine.

  2. Replace the placeholder <filename> with a file name of your choice and execute this script keytool -genkey -keyalg RSA -alias selfsigned -keystore <filename>.jks -storepass <enter password for keystore> -validity 720 -keysize 2048.

    Note: The password to the keystore must contain at least six characters.

    The keystore asks you to enter certain information.

  3. Enter your custom information, as given in the image for illustration.

Image omitted: MS-sharepoint-spoke-sponline-certificate-mac.png
Keystore custom information.
  1. Press Return.

    You are advised to migrate to PKCS12 format.

  2. Replace the placeholder <filename> with a file name of your choice and execute this script keytool -importkeystore -srckeystore <filename>.jks -destkeystore <filename>.jks -deststoretype pkcs12.

  3. Enter the source keystore password.

    The migration to PKCS12 is successful.

  4. Replace the placeholder <filename> with a file name of your choice and execute this script keytool -exportcert -keyalg RSA -alias selfsigned -keystore <filename>.jks -storepass <password to the keystore> -rfc -file <filename>.cer.

    The script generates the .cer file.

  5. To locate the .cer file, navigate to the location on your local disk.

Image omitted: MS-sharepoint-spoke-sponline-cer-file-generated.png
Location of the .cer file.

Configure an application in Microsoft Azure

Create a custom app using your Azure portal to authenticate requests.

Before you begin

  • Access to Microsoft Azure portal
  • Role required: admin

Procedure

  1. Upload the certificate to Microsoft Azure portal.

    1. Log in to https://portal.azure.com/.

    2. Select App registrations.

Image omitted: MS-sharepoint-spoke-app-reg-button.png
App registration button.
3.  Select **All applications** or **Owned applications.**
Image omitted: ms-sharepoint-spoke-graph-select-app.png
OAuth application selection options.
4.  In the search field, enter the name of the OAuth application you had created.

    To learn how to configure an OAuth application, see [Configure OAuth application in Microsoft Azure](configure-oauth-application-in-microsoft-azure.md).

5.  On the left panel, under Manage heading, select Certificates &amp; secrets.
Image omitted: MS-sharepoint-sponline-upload-certificate.png
Certificates &amp; secrets.
6.  Under Certificates &amp; secrets, select Certificates.
Image omitted: MS-sharepoint-sponline-certificate-section.png
Certificate section.
7.  Select **Upload certificate**.

8.  In the Upload certificate window, select the folder icon \(
Image omitted: MS-sharepoint-spoke-sponline-upload-certificate-icon.png
Folder icon.\) to navigate to the .cer file you had generated.
9.  In the Description field, enter a description of the certificate.

10. Select **Add**.

    The certificate is uploaded.

11. Under the **Thumbprint** column, copy the thumbprint value and store it at a secure place.
Image omitted: MS-sharepoint-spoke-sponline-copy-thumbprint.png
Thumbprint value.
    **Note:** Ensure that you copy the entire value of **Thumbprint**.

    Alternatively, you can copy the **Thumbprint** by clicking **Manifest**.
Image omitted: ms-exchng-ol-manifest.png
Copy value of Manifest.
12. Encode the Thumbprint value to a Base64 value and record the value for later use.

**Note:** You can use a Hexadecimal to Base64 \(Hex to Base64\) converter tool to encode the **Thumbprint** value to a Base64 value.
  1. Obtain permissions to access the REST APIs that the spoke needs to automate actions.

    1. On the left panel, under the Manage heading, select API permissions.
Image omitted: MS-sharepoint-spoke-graph-api-permissions-link.png
API permissions link.
2.  Under the Configured permissions heading, select **+ Add a permission**.

3.  In the Request API permissions window, select **SharePoint**.
Image omitted: MS-sharepoint-spoke-sponline-sharepoint-api.png
SharePoint API button.
4.  Select **Application permissions**.
Image omitted: MS-sharepoint-spoke-sponline-application-permission.png
Application permissions button.
5.  Expand the Sites list.

6.  Select Sites.FullControl.All.

    Your ServiceNow instance now has full control of all sites in Microsoft SharePoint Online.

7.  Select **Add permissions**.

    The permissions are added.
Image omitted: MS-sharepoint-spoke-sponline-permissions-granted.png
SharePoint online permissions granted.
8.  To grant admin consent, select **Grant admin consent for ServiceNow**.

9.  In the Grant admin consent confirmation window, select **Yes**.

    The admin consent is granted.
Image omitted: MS-sharepoint-sponline-admin-consent.png
Admin consent granted status.
    **Tip:** If you want to use other permissions apart from `Sites.FullControl.All`, contact your SharePoint and Azure administrators to determine the exact permissions that are needed for your organisational policies.

Attach a Java Key Store certificate

Enable the JWT Bearer Grant token authentication by attaching a valid Java Key Store (JKS) certificate.

Before you begin

  • Valid Java Key Store certificate
  • Role required: admin

Procedure

  1. Navigate to System Definition > Certificates.

  2. Open the record Microsoft SharePoint Online Certificate.

    Note: Ensure that you use the default record Microsoft SharePoint Online Certificate only.

  3. Enter the password associated with the JKS file in Key store password.

  4. Select Java Key Store as the Type.

  5. Click the attachments icon (

Image omitted: attachments-icon.png
Attachments icon\) and attach the JKS certificate you had generated.
For more information, see [Configure OAuth application in Microsoft Azure](configure-oauth-application-in-microsoft-azure.md).
  1. Click Validate Stores/Certificates.

  2. Click Update.

Configure the JWT signing key

Create a JSON Web Token (JWT) signing key to assign to your Java Key Store certificate.

Before you begin

Role required: admin

Procedure

  1. Navigate to System OAuth > JWT Keys.

  2. Open the record Microsoft SharePoint Online JWT Keys.

  3. Enter the password that is used to encrypt private key to generate the .PFX file and .CER file in Signing Key Password.

  4. Click Update.

Configure the JWT provider

Add a JSON Web Token (JWT) provider to your ServiceNow instance.

Before you begin

  • Copy and record the value of Application (client) ID and Directory (tenant) ID of the application you had registered in the Azure portal.
Image omitted: ms-sharept-clientid.png
Copy the values of Client ID and Tenant ID.
  • Role required: admin

Procedure

  1. Navigate to System OAuth > JWT Providers.

  2. Open the record Microsoft SharePoint Online JWT Provider.

  3. Enter values for iss, sub, and aud in the Standard Claims related list.

    FieldValue
    audMicrosoft Online URL in this format: https://login.microsoftonline.com/<tenant-id>/oauth2/token. Replace <tenant-id> with Directory (tenant) ID value of your application had registered in the Azure portal.
    issApplication (client) ID of the application you had registered in Azure portal.
    subApplication (client) ID of the application you had registered in Azure portal.
  4. Click Update.

Register Microsoft SharePoint Online as OAuth provider

Use the information generated during Microsoft SharePoint Online account configuration to register Microsoft SharePoint Online as an OAuth provider and allow the instance to request OAuth 2.0 tokens.

Before you begin

Role required: admin.

Procedure

  1. Navigate to System OAuth > Application Registry.

  2. Click New.

    The system displays the message What kind of OAuth application?

  3. Select Connect to a third party OAuth Provider.

    The system displays a blank Application Registries form.

  4. Enter these values.

    FieldValue required
    NameName to uniquely identify the record. For example, enter SharePoint OAuth profile.
    Client IDClient ID in this format: <ClientID>.
    Client SecretClient Secret you created during the Microsoft SharePoint Online account configuration.
    OAuth API ScriptSelect OAuthUtilSPJWTOnline.
    Default Grant typeSelect Client Credentials.
    Token URLToken URL in this format: https://login.microsoftonline.com/<tenant-id>/oauth2/token. Replace <tenant-id> with Directory (tenant) ID value of your application had registered in the Azure portal.
  5. In the OAuth Entity Scopes related list, insert a record with these values.

    NameOAuth scope
    scopehttps://<MS-SharePoint-tenant-name>.sharepoint.com/.default
Image omitted: ms-sharept-scopes.png
Insert the OAuth entity scope record.
  1. Right-click the form header, and click Save.

    The system validates the OAuth credentials and creates the OAuth Entity Profiles related list.

Result

The instance can request OAuth 2.0 tokens for the spoke.

Create credential records for the Microsoft SharePoint Online spoke

Create Credential records to the Microsoft SharePoint Online custom OAuth application you created during Microsoft SharePoint Online account configuration. The Microsoft SharePoint Online spoke connection and credential aliases use these credentials to authorize actions.

Before you begin

Role required: admin.

Procedure

  1. Navigate to Connections & Credentials > Credentials.

  2. Click New.

    The system displays the message What type of Credentials would you like to create?.

  3. Select OAuth 2.0 Credentials.

    The pop-up window displays a blank OAuth 2.0 Credentials form.

  4. Enter these values.

    FieldValue required
    NameEnter any name to uniquely identify the record. For example, enter SharePoint Credentials.
    ActiveEnable
    OAuth Entity ProfileSelect the OAuth profile you created when you registered the custom Microsoft SharePoint Online application as an OAuth provider. For example, select SharePoint OAuth profile.
    Applies toSelect the MID Servers that can use this credential. For example, select All MID Servers.
    OrderSelect the order to apply this credential. For example, enter 100.
  5. Save the record.

Create connection records for the Microsoft SharePoint Online spoke

Create Connection records to your Microsoft SharePoint Online account. The Microsoft SharePoint Online spoke connection and credential alias uses these connections to perform actions on Microsoft SharePoint Online.

Before you begin

Role required: admin.

Procedure

  1. Navigate to Connections & Credentials > Connection & Credential Aliases.

  2. Open the connection and credential alias record for MicrosoftSharePointOnline.

  3. From the Connections tab, click New.

    The system displays a blank HTTP(s) Connection form.

  4. On the form, fill in the fields.

    FieldValue required
    NameEnter any name to uniquely identify the connection record. For example, enter SharePoint Connection.
    CredentialSelect the Credential record you created for Microsoft SharePoint Online. For example, select SharePoint Credentials.
    Connection aliasSelect the Connection alias record you created for Microsoft SharePoint Online.
    ActiveEnable
    Connection URLEnter the root SharePoint URL. For example, https://<SiteName>.sharepoint.com.
  5. In the Attributes tab, enter the Base64 encoded value of Thumbprint.

    Note: The Thumbprint value is a hexadecimal value. You can use a Hexadecimal to Base64 (Hex to Base64) converter tool to encode the Thumbprint value to a Base64 value.

  6. Click Submit.

    The Microsoft SharePoint Online account is integrated with your ServiceNow instance and the spoke is ready to be used.

    Note: If the single sign-on is setup, configure your flows to retrieve the user details from Microsoft SharePoint Online using the spoke action, Look Up User Information By Login Name, to verify if the user is authorised to perform the required actions.

What to do next

  1. Navigate to Connections & Credentials > Credentials.
  2. Open the credential record you had created. For example, SharePoint Credentials.
  3. From Related Links, click Get OAuth Token.

    The system displays a confirmation message that the OAuth token flow is completed successfully. Review the details if the flow is not completed successfully.

    Note:

    • Confirm that the thumbprint has been defined in the connection record
    • Confirm that you allow pop-up windows in your browser. The spoke setup is completed and you can use the flows as per your requirement.

    Note: If the generated token doesn't work after the spoke setup, open your OAuth application in the Azure portal and select the two checkboxes under Implicit grant and hybrid flows.

Image omitted: ms-exchng-ol-tokens.png
Select the tokens in the Azure portal.