Skip to main content
Infisical supports two methods for connecting to GitLab: OAuth and Access Token. Choose the method that best fits your setup and security requirements.
  • OAuth Method
  • Access Token Method
The OAuth method provides secure authentication through GitLab’s OAuth flow.
Using the GitLab Connection with OAuth on a self-hosted instance of Infisical requires configuring an OAuth application in GitLab and registering your instance with it.Prerequisites:
  • A GitLab account with existing projects
  • Self-hosted Infisical instance
1

Create an OAuth application in GitLab

Navigate to your user Settings > Applications to create a new GitLab application.
GitLab Dashboard
GitLab Applications Settings
Create the application. As part of the form, set the Redirect URI to https://your-domain.com/organization/app-connections/gitlab/oauth/callback.Depending on your use case, add one or more of the following scopes to your application:
  • Secret Sync
  • Secret Scanning
For Secret Syncs, your application will require the api scope:
GitLab New Application Form
GitLab New Application Form
The domain you defined in the Redirect URI should be equivalent to the SITE_URL configured in your Infisical instance.
If you have a GitLab group, you can create an OAuth application under it in your group Settings > Applications.
2

Add your GitLab OAuth application credentials to Infisical

Obtain the Application ID and Secret for your GitLab OAuth application.
GitLab Application Credentials
Back in your Infisical instance, add two new environment variables for the credentials of your GitLab OAuth application:
  • INF_APP_CONNECTION_GITLAB_OAUTH_CLIENT_ID: The Application ID of your GitLab OAuth application.
  • INF_APP_CONNECTION_GITLAB_OAUTH_CLIENT_SECRET: The Secret of your GitLab OAuth application.
Once added, restart your Infisical instance and use the GitLab Connection.

Setup GitLab OAuth Connection in Infisical

1

Navigate to App Connections

Navigate to the App Connections page in the desired project.
App Connections Tab
2

Add Connection

Select the GitLab Connection option from the connection options modal.
Select GitLab Connection
3

Choose OAuth Method

Select the OAuth method and click Connect to GitLab.
Connect via GitLab OAuth
4

Grant Access

You will be redirected to GitLab to grant Infisical access to your GitLab account. Once granted, you will be redirected back to Infisical’s App Connections page.
GitLab Authorization
5

Connection Created

Your GitLab Connection is now available for use.
GitLab OAuth Connection