Configure OAuth Authentication

To retrieve content from ServiceNow using OAuth authentication, you must obtain OAuth tokens. The ServiceNow Connector is supplied with an OAuth configuration tool to obtain the tokens.

NOTE: There is no need to complete this procedure in the following cases:

  • You want to authenticate with ServiceNow using basic authentication.
  • You chose OAuth authentication during the installation process and the OAuth configuration tool ran successfully.

To obtain OAuth tokens

  1. Open the folder where you installed the connector.
  2. Open the file oauth_tool.cfg in a text editor.
  3. In the [Default] section, specify any SSL or proxy settings necessary to connect to ServiceNow:

    SSLMethod The version of SSL/TLS to use. This parameter accepts the same values as the connector configuration parameter SSLMethod. To use the highest protocol supported by both client and server, set this parameter to NEGOTIATE.
    ProxyHost The host name or IP address of the proxy server that the connector must use.
    ProxyPort The port of the proxy server that the connector must use.

    For example:

    SSLMethod=NEGOTIATE
    ProxyHost=10.0.0.1
    ProxyPort=8080
  4. In the [OAuthTool] section, set the following parameters:

    AppKey The Client ID provided when you created the ServiceNow application to represent the connector.
    AppSecret The Client Secret provided when you created the ServiceNow application to represent the connector.
    TokenUrl This parameter is already set, but you must replace the placeholder <ServiceNowInstance> with the name of your ServiceNow instance.
    TokenParameters This parameter is already set, but you must replace the placeholders <Username> and <Password> with the username and password that you use to log on to ServiceNow. Use an account that can access all of the data that you want to retrieve (such as an administrator).
    RefreshUrl This parameter is already set, but you must replace the placeholder <ServiceNowInstance> with the name of your ServiceNow instance.

    Do not modify the other parameters in this section.

  5. Open a command-line window and run oauth_tool.exe.

    The OAuth tool sends requests to the ServiceNow API to obtain the necessary OAuth tokens. The OAuth tool creates files named oauth.cfg and oauth2_sites.bin, in the connector's installation folder. These contain the information required by the connector to authenticate with ServiceNow. The default configuration automatically uses this information to authenticate with ServiceNow, because the connector configuration file includes the following line to import the parameters from oauth.cfg into the [MyTaskOAuth] section:

    [MyTaskOAuth] < "oauth.cfg" [OAUTH]

    For more information about including parameters from another file, see Include an External Configuration File. The OAuth tool also prints the parameters it has set to the command-line window so that you can set these directly in the connector's configuration file if you prefer.

    You can now configure a task to retrieve data from ServiceNow. See Retrieve Information from ServiceNow (OAuth Authentication).