DataSync meshlets that target a database, like the Snowflake meshlet, require making API calls to your ServiceNow instance in order to obtain the schemas of tables you are sharing. This way the meshlets know the table's structure to create the table properly in the target database.

By default, the meshlets use Basic Authentication to make API calls to your instance. However, you can also have the meshlet use ServiceNow's OAuth 2.0 implementation to make the API calls.

With the OAuth 2.0 implementation, the meshlet will initially use your credentials configured in the meshlet's configuration file to request an access token from your ServiceNow instance it will then use for accessing the table schema API. If the access token expires, it will use the refresh token to request a new access token. If the refresh token is expired, it will start the process all over again, using your credentials configured to request a new access token.

Prerequisites


  • Configure your ServiceNow instance as an OAuth API endpoint for external clients. You can also see here and here for additional details on setting this up in your ServiceNow instance.
  • Create a ServiceNow user. This user must have the perspectium role in order to access the table schemas through the ServiceNow APIs. You can specify the user to have the Web service access only option selected if this user should only be used for the integration and not be able to login to your ServiceNow instance.


ServiceNow OAuth Configuration

For a meshlet to connect to your ServiceNow instance using OAuth, you will need to include the following configurations under perspectium.auth

KeyDefault ValueDescription

type

basicauth

The type of authentication/authorization to use for connecting to your ServiceNow instance to get table schemas. 

To use ServiceNow's OAuth 2.0 implementation, enter the value servicenowoauth.

If no value is specified, this will default to basicauth and use Basic Authentication.

perspectium:
   auth:
      type: servicenowoauth
username

Username for connecting to your ServiceNow instance. These credentials are used for the first request of an access token from your instance and if necessary, to request the access token again when your refresh token is expired.

(info) NOTE: This user must have the perspectium role.

You can select the Web service access only option for this user if this user should only be used for the integration and not be able to login to your ServiceNow instance.

perspectium:
   auth:
      username: user1
password

Password for connecting to your ServiceNow instance. These credentials are used for the first request of an access token from your instance and if necessary, to request the access token again when your refresh token is expired.

(info) NOTE: This user must have the perspectium role.

You can select the Web service access only option for this user if this user should only be used for the integration and not be able to login to your ServiceNow instance.

perspectium:
   auth:       
      password: password123
clientId

The Client ID when you created the OAuth API endpoint for external clients in your ServiceNow instance. These credentials are used to request the access token from your instance and refresh the token when it expires.

perspectium:
   auth:       
      clientId: abcabcabcabc
clientSecret

The Client Secret when you created the OAuth API endpoint for external clients in your ServiceNow instance. These credentials are used to request the access token from your instance and refresh the token when it expires.

perspectium:
   auth:       
      clientSecret: def456^)




Example of a meshlet configuration yaml file

The example below shows a basic configuration of the meshlet configuration yaml file (i.e. application.yml or application-dev.yml)

perspectium:    
   auth:
      url: https://acmedev.service-now.com
      type: servicenowoauth
      username: user1
      password: password123
      clientId: abcabcabcabc
      clientSecret: def456^)
  • No labels