How to create Oauth2 credentials for GitLab
How to create Oauth2 credentials for GitLab
In this guide, I’ll share the process for creating OAuth2 credentials in GitLab and connecting them to Composio. Let’s get started
Setting up GitLab
GitLab allows you to create OAuth applications directly from your account settings. These apps give you the Client ID and Client Secret needed to connect securely.
NOTE: You’ll need a GitLab account. If you don’t have one, sign up for free at gitlab.com.
Step 1: Log in to GitLab
Go to GitLab and sign in.
In the top-right corner, click on your profile avatar.
From the dropdown, select Edit profile.

Step 2: Navigate to Applications
In the left-hand sidebar, scroll down and click Applications.
(Direct link: https://gitlab.com/-/profile/applications
)

This is where you can create and manage your OAuth apps.
Step 3: Create a New OAuth Application
Click on New Application.
Fill in the fields as follows:
Name → Example:
Composio GitLab Integration
Redirect URI → Paste the Composio callback URL:
<https://backend.composio.dev/api/v1/auth-apps/add>
Make sure it’s exact (no trailing /
).
Scopes → Select the following (depending on what you want Composio to access):
read_user
(to read user profile info)api
(to access GitLab APIs)read_api
(if you want limited read-only access)

For testing, you can just tick read_user
and api
.
Step 4: Save and Copy Credentials
Click Save application.
GitLab will now show you:
Application ID → This is your Client ID.
Secret → This is your Client Secret.

Copy the secret immediately, GitLab only shows it once!
Creating the Auth Config in Composio
With your GitLab OAuth credentials ready, let’s configure them inside Composio.
Open the Composio Dashboard.
Click on Create Auth Config.

From the list of toolkits, select GitLab.
Choose OAuth2 as the authentication type.

Step 5: Fill in Your OAuth Details
In the Manage Auth Config section:
Client ID → Paste your GitLab Application ID.
Client Secret → Paste your GitLab Secret.
Redirect URI → Must match exactly:
Base
<https://backend.composio.dev/api/v3/auth-apps/add>
Scopes → Add the same scopes you enabled when creating the app (
read_user
,api
, etc.).


Click Create Gitlab Auth Config.
Authorize and Connect
Get the External User ID from GitLab in the profile section

In Composio, click Connect Account on your GitLab Auth Config and enter the User ID.

The GitLab consent screen will open, displaying the requested permissions.
Click Authorise.

Composio securely stores the access token upon success.
Base URL for GitLab
By default, use GitLab’s hosted API:
<https://gitlab.com/api/v4>
If you are using a self-hosted GitLab instance, replace the base URL with your instance’s API endpoint.
That’s it! You’ve now set up OAuth2 credentials for GitLab and connected it with Composio.
In this guide, I’ll share the process for creating OAuth2 credentials in GitLab and connecting them to Composio. Let’s get started
Setting up GitLab
GitLab allows you to create OAuth applications directly from your account settings. These apps give you the Client ID and Client Secret needed to connect securely.
NOTE: You’ll need a GitLab account. If you don’t have one, sign up for free at gitlab.com.
Step 1: Log in to GitLab
Go to GitLab and sign in.
In the top-right corner, click on your profile avatar.
From the dropdown, select Edit profile.

Step 2: Navigate to Applications
In the left-hand sidebar, scroll down and click Applications.
(Direct link: https://gitlab.com/-/profile/applications
)

This is where you can create and manage your OAuth apps.
Step 3: Create a New OAuth Application
Click on New Application.
Fill in the fields as follows:
Name → Example:
Composio GitLab Integration
Redirect URI → Paste the Composio callback URL:
<https://backend.composio.dev/api/v1/auth-apps/add>
Make sure it’s exact (no trailing /
).
Scopes → Select the following (depending on what you want Composio to access):
read_user
(to read user profile info)api
(to access GitLab APIs)read_api
(if you want limited read-only access)

For testing, you can just tick read_user
and api
.
Step 4: Save and Copy Credentials
Click Save application.
GitLab will now show you:
Application ID → This is your Client ID.
Secret → This is your Client Secret.

Copy the secret immediately, GitLab only shows it once!
Creating the Auth Config in Composio
With your GitLab OAuth credentials ready, let’s configure them inside Composio.
Open the Composio Dashboard.
Click on Create Auth Config.

From the list of toolkits, select GitLab.
Choose OAuth2 as the authentication type.

Step 5: Fill in Your OAuth Details
In the Manage Auth Config section:
Client ID → Paste your GitLab Application ID.
Client Secret → Paste your GitLab Secret.
Redirect URI → Must match exactly:
Base
<https://backend.composio.dev/api/v3/auth-apps/add>
Scopes → Add the same scopes you enabled when creating the app (
read_user
,api
, etc.).


Click Create Gitlab Auth Config.
Authorize and Connect
Get the External User ID from GitLab in the profile section

In Composio, click Connect Account on your GitLab Auth Config and enter the User ID.

The GitLab consent screen will open, displaying the requested permissions.
Click Authorise.

Composio securely stores the access token upon success.
Base URL for GitLab
By default, use GitLab’s hosted API:
<https://gitlab.com/api/v4>
If you are using a self-hosted GitLab instance, replace the base URL with your instance’s API endpoint.
That’s it! You’ve now set up OAuth2 credentials for GitLab and connected it with Composio.