Microsoft Azure AD – Graph API to ServiceNow Integration Using REST Message

Here we are going to Integrate Microsoft Azure AD users to ServiceNow using REST Message. Follow the below steps.

Step 1: Application Registry

  • Navigate to System OAuth -> Application Registry
  • Click New and select Connect to a third party OAuth Provider
  • Fill the field values as below,
    • Name: Azure AD – API Graph
    • Client ID: In Azure AD Portal, Navigate to App Registrations from left menu and get the Application ID.
  • Client Secret: In Azure AD Portal, Navigate to App Registrations from left menu. Open the App. Now in left nav open Certificates and Secrets. Click new to create client secret. after save, copy the value before refresh the page.
  • Default Grant type: Set this to Client Credentials
    • Refresh Token Lifespan: You can leave this at the default of 8.640.000.
    • Token URL: Set this to https://login.microsoftonline.com/<your_tenant_id>/oauth2/v2.0/token
  • Redirect URL: Set this to https://<your_instance>.service-now.com/oauth_redirect.do where <your_instance> is the name of your ServiceNow instance.
  • Finally, the Application Registry page will be like this,
  • In the OAuth Entity Profiles embedded list, click Insert a new row and then enter a Name for the profile and Grant Type as Client Credentials.

The system creates the profile record.

  • In the OAuth Entity Scopes embedded list, click Insert a new row and then enter a Name as Default and OAuth Scope as .default
  • Right-click the Application Registry form header and select Save.

Step 2: REST Message

  • Navigate to System Web Services -> REST Message
    • Create New
    • Fill the fields as below,
      • Name: Enter a descriptive name for this message.
      • Authentication type: OAuth2.0
      • OAuth Profile: Select theOAuth Entity Profile which is created in Application Registry’s embedded list.
  • Save the Record.Click Get OAuth Token in the Related Links to get the token.

Step 3: HTTP Methods

Create HTTP Methods in the related list of created REST Message.

  • Open the created REST Message.
  • In HTTP Methods related list click New to create.
  • Fill the details as below,
    • Name: Get All Users
    • HTTP method: GET
    • Authentication type: Inherit from parent
    • HTTP Headers Embedded List -> Name: Accept

   Value: application/json

  • Save the Record.
    • In Related List, Click Test to get all users from Azure AD.
0 0 vote
Article Rating
0 Comments
Inline Feedbacks
View all comments