Connect to a Git provider using OAuth 2.0
Set up an OAuth 2.0 application registry and credentials to connect to your Git provider from ServiceNow Studio.
Parent Topic:Fluent source control in ServiceNow Studio
Configure an OAuth 2.0 application registry for ServiceNow Studio
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. The instance supports GitHub, GitLab, Bitbucket, and Azure Repos by default.
Role required: admin
Important: For Azure Repos, update the maximum length of the Client Secret field to 2048 before you add the secret.
- Navigate to All > System Definition > Tables.
- Filter the table by entering
oauth_entityfor the Name field. - Select the Application Registries [oauth_entity] table.
- In the Columns related list, locate the Client Secret column and enter
2048as the value of its Max length attribute. - Select Update.
About this task
To use OAuth 2.0 authentication with ServiceNow Studio, 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
-
Navigate to All > System OAuth > Application Registry.
-
Select New to open the interceptor page.
-
On the interceptor page, select Connect to a third-party OAuth provider to open the Application Registries form.
-
On the form, fill in the fields to register your Git provider's OAuth application.
For additional information about fields on the form, see Connect to a third-party OAuth provider.
|
Field |
Description |
|---|---|
|
Name |
Unique name for the third-party OAuth connection. |
|
Client ID |
Client ID of the OAuth application in your Git provider. |
|
Client Secret |
Client secret of the OAuth application in your Git provider. |
|
OAuth API Script |
Script used to customize request and response to the external OAuth provider. Select one of the following depending on your Git provider:- GitHub: OauthAPIScriptForGitHub
|
|
Default Grant type |
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 |
Time, in seconds, that the refresh token is valid. |
|
Application |
Application scope that contains this record. |
|
Accessible from |
Option to make the application registry accessible from all application scopes or from this scope only. |
|
Active |
Option for turning the OAuth application on or off. |
|
Authorization URL |
OAuth authorization code endpoint for your Git domain. For example:- GitHub:
|
|
Token URL |
OAuth server token endpoint for your Git domain. For example:- GitHub:
|
|
Redirect URL |
OAuth callback endpoint. If empty, the instance auto-generates a value of |
|
Use mutual authentication |
Option to use mutual authentication. Leave this option cleared to turn off using mutual authentication for token request and revocation. |
|
Send Credentials |
Method in which the OAuth client populates the client credentials in the request.- For GitHub, GitLab, or Bitbucket, select As Basic Authorization header.
|
What to do next
After you register the OAuth application, connect your credentials to Git. For more information, see Configure OAuth 2.0 credentials to connect to a Git provider.
Configure OAuth 2.0 credentials to connect to a Git provider
Connect to a Git domain or repository using OAuth 2.0 credentials to manage applications in source control from ServiceNow Studio.
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 ServiceNow Studio.
- Create a dedicated Git repository for an application in a Git provider such as GitHub, GitLab, Bitbucket, or Azure Repos.
Role required: admin
Procedure
-
Navigate to All > App Engine > ServiceNow Studio.
-
Use one of the following keyboard shortcuts to open the command palette:
- Windows: Ctrl-Shift-P
- Mac: Cmd-Shift-P
-
Enter
Git: Set IDE Git credentialsand press Enter. -
From the New Git credential form, select OAuth to authenticate with an OAuth 2.0 profile.
-
On the form, fill in the fields to identify your repository and OAuth profile.
|
Field |
Description |
|---|---|
|
Git repository URL |
HTTPS URL of a Git repository associated with your Git credentials. |
|
Git username |
Your user name for the Git provider. |
|
Select an OAuth profile |
OAuth 2.0 credentials from your Git provider.An administrator creates the OAuth profile when configuring the application registry. |
|
Use this credential for all repositories |
Option to use the credentials for all repositories in the Git domain associated with the Git repository URL. |
The first time you use a Git command, a prompt asks you to authorize your user from the Git provider.
Result
The instance associates your Git credentials with your user and uses them for all repositories in the domain from the Git repository URL. If you add different credentials for a repository in the same domain, the instance uses the new credentials and sets the previous credentials to inactive.
What to do next
After you initialize or clone a repository, you can begin using source control. For more information, see Using Fluent source control in ServiceNow Studio.
To manage existing Git credentials, use the Git: Manage Git credentials command from the command palette.
---
title: Connect to a Git provider using OAuth 2.0
description: Set up an OAuth 2.0 application registry and credentials to connect to your Git provider from ServiceNow Studio.Configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider.Connect to a Git domain or repository using OAuth 2.0 credentials to manage applications in source control from ServiceNow Studio.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/application-development/servicenow-studio-classic/fluent-sc-connect-to-git-provider-oauth-2-0.html
release: brazil
product: ServiceNow Studio Classic
classification: servicenow-studio-classic
topic_type: concept
last_updated: "2026-10-08"
reading_time_minutes: 5
keywords: [Oauth, ServiceNow Studio, Git provider, OAuth 2.0 credentials, pro-code development, ServiceNow Studio]
breadcrumb: [Fluent source control in ServiceNow Studio, Source control integration, Use, ServiceNow Studio, Build, AI Workflow Factory Prime, Agentic app development, Building applications]
---
# Connect to a Git provider using OAuth 2.0
Set up an OAuth 2.0 application registry and credentials to connect to your Git provider from ServiceNow Studio.
**Parent Topic:**[Fluent source control in ServiceNow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/servicenow-studio-classic/fluent-source-control-sn-studio.md)
## Configure an OAuth 2.0 application registry for ServiceNow Studio
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. The instance supports GitHub, GitLab, Bitbucket, and Azure Repos by default.
Role required: admin
**Important:** For Azure Repos, update the maximum length of the **Client Secret** field 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**.
### About this task
To use OAuth 2.0 authentication with ServiceNow Studio, 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**.
2. Select **New** to open the interceptor page.
3. On the interceptor page, select **Connect to a third-party OAuth provider** to open the Application Registries form.
4. On the form, fill in the fields to register your Git provider's OAuth application.
For additional information about fields on the form, see [Connect to a third-party OAuth provider](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/platform-security/connect-3rd-party-oauth-provider.md).
<table id="table_sgc_qqv_yq"><thead><tr><th>
Field
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Name
</td><td>
Unique name for the third-party OAuth connection.
</td></tr><tr><td>
Client ID
</td><td>
Client ID of the OAuth application in your Git provider.
</td></tr><tr><td>
Client Secret
</td><td>
Client secret of the OAuth application in your Git provider.
</td></tr><tr><td>
OAuth API Script
</td><td>
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
**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”.
</td></tr><tr><td>
Default Grant type
</td><td>
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.
</td></tr><tr><td>
Refresh Token Lifespan
</td><td>
Time, in seconds, that the refresh token is valid.
</td></tr><tr><td>
Application
</td><td>
Application scope that contains this record.
</td></tr><tr><td>
Accessible from
</td><td>
Option to make the application registry accessible from all application scopes or from this scope only.
</td></tr><tr><td>
Active
</td><td>
Option for turning the OAuth application on or off.
</td></tr><tr><td>
Authorization URL
</td><td>
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`
</td></tr><tr><td>
Token URL
</td><td>
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`
</td></tr><tr><td>
Redirect URL
</td><td>
OAuth callback endpoint. If empty, the instance auto-generates a value of `https://<instance>/oauth_redirect.do`.
</td></tr><tr><td>
Use mutual authentication
</td><td>
Option to use mutual authentication. Leave this option cleared to turn off using mutual authentication for token request and revocation.
</td></tr><tr><td>
Send Credentials
</td><td>
Method 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\)**.
</td></tr></tbody>
</table>5. Select **Submit** to save the application registry.
### What to do next
After you register the OAuth application, connect your credentials to Git. For more information, see [Configure OAuth 2.0 credentials to connect to a Git provider](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/servicenow-studio-classic/fluent-sc-connect-to-git-provider-oauth-2-0.md).
## Configure OAuth 2.0 credentials to connect to a Git provider
Connect to a Git domain or repository using OAuth 2.0 credentials to manage applications in source control from ServiceNow Studio.
### 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 ServiceNow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/servicenow-studio-classic/fluent-sc-connect-to-git-provider-oauth-2-0.md).
- Create a dedicated Git repository for an application in a Git provider such as GitHub, GitLab, Bitbucket, or Azure Repos.
Role required: admin
### Procedure
1. Navigate to **All** > **App Engine** > **ServiceNow Studio**.
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** to authenticate with an OAuth 2.0 profile.
5. On the form, fill in the fields to identify your repository and OAuth profile.
<table id="table_dnr_vhy_ckc"><thead><tr><th>
Field
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Git repository URL
</td><td>
HTTPS URL of a Git repository associated with your Git credentials.
</td></tr><tr><td>
Git username
</td><td>
Your user name for the Git provider.
</td></tr><tr><td>
Select an OAuth profile
</td><td>
OAuth 2.0 credentials from your Git provider.An administrator creates the OAuth profile when configuring the application registry.
</td></tr><tr><td>
Use this credential for all repositories
</td><td>
Option to use the credentials for all repositories in the Git domain associated with the Git repository URL.
</td></tr></tbody>
</table>6. Select **Submit**.
The first time you use a Git command, a prompt asks you to authorize your user from the Git provider.
### Result
The instance associates your Git credentials with your user and uses them for all repositories in the domain from the Git repository URL. If you add different credentials for a repository in the same domain, the instance uses the new credentials and sets the previous credentials to inactive.
### What to do next
After you initialize or clone a repository, you can begin using source control. For more information, see [Using Fluent source control in ServiceNow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/servicenow-studio-classic/fluent-sc-using-fluent-source-control.md).
To manage existing Git credentials, use the `Git: Manage Git credentials` command from the command palette.
| title | Connect to a Git provider using OAuth 2.0 |
| description | Set up an OAuth 2.0 application registry and credentials to connect to your Git provider from ServiceNow Studio.Configure how the client ID and secret are sent to the OAuth 2.0 provider associated with your Git provider.Connect to a Git domain or repository using OAuth 2.0 credentials to manage applications in source control from ServiceNow Studio. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/application-development/servicenow-studio-classic/fluent-sc-connect-to-git-provider-oauth-2-0.html |
| release | brazil |
| product | ServiceNow Studio Classic |
| classification | servicenow-studio-classic |
| topic_type | concept |
| last_updated | 2026-10-08 |
| reading_time_minutes | 5 |
| keywords | OauthServiceNow StudioGit providerOAuth 2.0 credentialspro-code developmentServiceNow Studio |
| breadcrumb | Fluent source control in ServiceNow StudioSource control integrationUseServiceNow StudioBuildAI Workflow Factory PrimeAgentic app developmentBuilding applications |