---
sourceDocument: Australia Build or modify applications
sourceDocumentLink: https://www.servicenow.com/docs/r/application-development

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Connect to a Git provider using OAuth 2.0

# Connect to a Git provider using OAuth 2.0 with the ServiceNow IDE {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

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

* [Using source control in the ServiceNow IDE](https://www.servicenow.com/docs/2alXFPy8ORAy6aQCFq5_SQ "Use Git commands and other source control features in the ServiceNow IDE to manage changes to an application across a development team.")  
**Related tasks**   

* [Connect to a Git provider using basic authentication with the ServiceNow IDE](https://www.servicenow.com/docs/glvDLZ81G_qGrBFCGBI2hA "Connect to a Git domain using basic authentication credentials to manage applications in source control from the ServiceNow IDE.")
* [Configure a MID Server to use source control with the ServiceNow IDE](https://www.servicenow.com/docs/qwNiBRjXF3vqdzUsuJwojw "Configure a MID Server to use source control with the ServiceNow IDE if your Git provider is behind a firewall.")
* [Initialize a Git repository with the ServiceNow IDE](https://www.servicenow.com/docs/6IqrDq~otJBJl6m02QAcRg "Initialize a local Git repository for an application and push it to a remote Git repository to manage an application in source control.")

## Configure an OAuth 2.0 application registry for the ServiceNow IDE {#ariaid-title2}

Configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider.{#connect-git-oauth__otherprops-integration-3}

### 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 AllSystem DefinitionTables.
2. Filter the table by entering <kbd class="ph userinput">oauth_entity</kbd> 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 <kbd class="ph userinput">2048</kbd> as the value of its Max length attribute.
5. Select Update.
{#connect-git-oauth__ol_rxn_glx_xcc}

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 AllSystem OAuthApplication 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](https://www.servicenow.com/docs/access?context=connect-3rd-party-oauth-provider&version=australia&pubname=australia-platform-security&ft:locale=en-US).
   {#connect-git-oauth__table_sgc_qqv_yq__entry__2}

   | Field | Description |
   |-|-|
   | Name | A unique name for the third-party OAuth connection. |
   | Client ID | The client ID of the OAuth application in your Git provider. |
   | Client Secret | The client secret of the OAuth application in your Git provider. |
   | OAuth API Script | The script used to customize request and response to the external OAuth provider. Select one of the following depending on your Git provider: * GitHub: OauthAPIScriptForGitHub * GitLab: OauthAPIScriptForGitLab * Bitbucket: OauthAPIScriptForBitbucket * Azure Repos: OauthAPIScriptForAzureRepos {#connect-git-oauth__ul_hbq_th5_5bc} Note: To use other Git providers, you can use these scripts as examples to create your own OAuth API script for your OAuth provider. The name of the script must begin with "Oauth". |
   | Default Grant type | The default grant type used to establish the token. Select Authorization code. An authorization code is granted to the client to obtain an access token, which is then used to obtain access to the resource. |
   | Refresh Token Lifespan | The time, in seconds, that the refresh token is valid. |
   | Application | The application scope that contains this record. |
   | Accessible from | An option to make the application registry accessible from all application scopes or from this scope only. |
   | Active | An option for turning the OAuth application on or off. |
   | Authorization URL | The OAuth authorization code endpoint for your Git domain. For example: * GitHub: https://github.com/login/oauth/authorize * GitLab: https://gitlab.com/oauth/authorize * Bitbucket: https://bitbucket.org/site/oauth2/authorize * Azure Repos: https://app.vssps.visualstudio.com/oauth2/authorize {#connect-git-oauth__ul_z1w_4g4_ncc} |
   | Token URL | The OAuth server token endpoint for your Git domain. For example: * GitHub: https://github.com/login/oauth/access_token * GitLab: https://gitlab.com/oauth/token * Bitbucket: https://bitbucket.org/site/oauth2/access_token * Azure Repos: https://app.vssps.visualstudio.com/oauth2/token {#connect-git-oauth__ul_aft_swv_ncc} |
   | Redirect URL | The OAuth callback endpoint. If empty, the instance auto-generates a value of https://\<instance\>/oauth_redirect.do. |
   | Use mutual authentication | An option to use mutual authentication. Leave this option cleared to turn off using mutual authentication for token request and revocation. |
   | Send Credentials | The way in which the OAuth client populates the client credentials in the request. * For GitHub, GitLab, or Bitbucket, select As Basic Authorization header. * For Azure Repos, select In Request Body (Form URL-Encoded). {#connect-git-oauth__ul_mqz_chx_xcc} |
   [Table 1. Application Registries form]

   {#connect-git-oauth__table_sgc_qqv_yq}
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 {#ariaid-title3}

Connect to a Git domain using OAuth 2.0 credentials to manage applications in source control from the ServiceNow IDE.{#authenticate-git-repository-oauth__otherprops-integration-2}

### 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](https://www.servicenow.com/docs/FRp~BytHqyih5wleGNwt1Q#connect-git-oauth "Configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider.").
* Create a dedicated Git repository for an application in a Git provider such as GitHub, GitLab, Bitbucket, or Azure Repos.

{#authenticate-git-repository-oauth__ul_r1b_j15_5bc}

Role required: admin

### Procedure

1. Navigate to AllApp DevelopmentServiceNow IDE.
2. Use one of the following keyboard shortcuts to open the command palette:  
   * Windows: Ctrl-Shift-P
   * Mac: Cmd-Shift-P
   {#authenticate-git-repository-oauth__ul_j4x_ns4_gcc}
3. Enter <kbd class="ph userinput">Git: Set IDE Git credentials</kbd> and press Enter.
4. From the New Git credential form, select OAuth.
5. On the form, fill in the fields.  
   {#authenticate-git-repository-oauth__table_lxq_myn_sbc__entry__2}

   | 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. |
   [Table 2. New Git credential form]

   {#authenticate-git-repository-oauth__table_lxq_myn_sbc}
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](https://www.servicenow.com/docs/2alXFPy8ORAy6aQCFq5_SQ "Use Git commands and other source control features in the ServiceNow IDE to manage changes to an application across a development team.").

To manage existing Git credentials, use the <kbd class="ph userinput">Git: Manage Git credentials</kbd> command from the command palette.

*[\>]: and then


