Set up an OAuth 2.0 application registry and credentials to connect to your Git provider from the ServiceNow IDE.

Configure an OAuth 2.0 application registry for the ServiceNow IDE

Configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider.

Before you begin

Create an OAuth application with your Git provider and configure it to redirect to your instance. In this OAuth application, use your instance URL as the homepage URL and https://<instance>/oauth_redirect.do for the authorization callback URL. GitHub, GitLab, Bitbucket, and Azure Repos are supported by default.

Important: For Azure Repos, the maximum length of the Client Secret field must be updated to 2048 before you add the secret.
  1. Navigate to All > System Definition > Tables.
  2. Filter the table by entering oauth_entity for the Name field.
  3. Select the Application Registries [oauth_entity] table.
  4. In the Columns related list, locate the Client Secret column and enter 2048 as the value of its Max length attribute.
  5. Select Update.

Role required: admin

About this task

To use OAuth 2.0 authentication with the ServiceNow IDE, you must register the OAuth application you created from your Git provider. Follow this procedure to configure an OAuth application registry [oauth_entity] on your instance.

Procedure

  1. Navigate to All > System OAuth > Application Registry and then select New.
  2. On the interceptor page, select Connect to a third-party OAuth provider.
  3. On the form, fill in the fields.

    For additional information about fields on the form, see Connect to a third-party OAuth provider.

  4. Select Submit.

What to do next

Developers using the ServiceNow IDE must configure their own OAuth 2.0 credentials.

Configure OAuth 2.0 credentials to connect to a Git provider with the ServiceNow IDE

Connect to a Git domain using OAuth 2.0 credentials to manage applications in source control from the ServiceNow IDE.

Before you begin

  • An administrator must configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider. For more information, see Configure an OAuth 2.0 application registry for the ServiceNow IDE.
  • Create a dedicated Git repository for an application in a Git provider such as GitHub, GitLab, Bitbucket, or Azure Repos.

Role required: sn_glider.ide_git_user or admin

Procedure

  1. Navigate to All > App Development > ServiceNow IDE.
  2. Use one of the following keyboard shortcuts to open the command palette:
    • Windows: Ctrl-Shift-P
    • Mac: Cmd-Shift-P
  3. Enter Git: Set IDE Git credentials and press Enter.
  4. From the New Git credential form, select OAuth.
  5. On the form, fill in the fields.
    Table 2. New Git credential form
    Field Description
    Git repository URL The HTTPS URL of a Git repository associated with your Git credentials.
    Git username Your Git user name.
    Select an OAuth profile The OAuth 2.0 credentials for your Git provider.

    The OAuth profile is created with the application registry, which must be configured by an administrator.

  6. Select Submit.

    The first time you use a Git command, you're prompted to authorize your user from the Git provider.

Result

Your Git credentials are associated with your user on the instance and used for all repositories in the domain from the Git repository URL. If you add different credentials for a repository in the same domain, the new credentials are used and the previous credentials are set to inactive.

What to do next

After initializing or cloning a repository, you can begin using source control. For more information, see Using source control in the ServiceNow IDE.

To manage existing Git credentials, use the Git: Manage Git credentials command from the command palette.