Service Now Service Now: Access Tokens

Summary

Use the actions here to create an AccessDetails Dictionary if you don't have an access token.

Actions

service_now.access_tokens.

from_password_auth

Generate an OAuth access token using a username & password.

The access token will be generated for the identity supplied as username.

Minimum Plugin Version: 1.1.0

Input
  • address: the ServiceNow instance address

  • client_id: the client_id for the PPA OAuth application

  • client_secret: the client_secret for the PPA OAuth application

  • username: username for authentication

  • password: password for authentication

Output

An AccessDetails Dictionary.

Example
  • In this example the sensitive information was retrieved earlier from a vault (not shown)
1
2
3
4
5
6
7
8
- service_now.access_tokens.from_password_auth:
    address: my-instance.servicenow.com
  load:
    client_id: service_now_client_id
    client_secret: service_now_client_secret
    username: service_now_username
    password: service_now_password
  save: access_details

service_now.access_tokens.

from_refresh_token

Generate an OAuth access token using a refresh token.

Minimum Plugin Version: 1.0.0

Input
  • address: the ServiceNow instance address

  • client_id: the client_id for the PPA OAuth application

  • client_secret: the client_secret for the PPA OAuth application

  • refresh_token: a refresh token generated for the PPA OAuth application

Output

An AccessDetails Dictionary.

Example
  • In this example the sensitive information was retrieved earlier from a vault (not shown)
1
2
3
4
5
6
7
- service_now.access_tokens.from_refresh_token:
    address: my-instance.servicenow.com
  load:
    client_id: service_now_client_id
    client_secret: service_now_client_secret
    refresh_token: service_now_refresh
  save: access_details