Learn how to configure a GitLab Connection for Infisical using OAuth or Access Token methods.
Infisical supports two methods for connecting to GitLab: OAuth and Access Token. Choose the method that best fits your setup and security requirements.
The OAuth method provides secure authentication through GitLab’s OAuth flow.
Self-Hosted Instance Setup
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:
Create an OAuth application in GitLab
Navigate to your user Settings > Applications to create a new GitLab application.
Create the application. As part of the form, set the Redirect URI to https://your-domain.com/organization/app-connections/gitlab/oauth/callback
.
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.
Add your GitLab OAuth application credentials to Infisical
Obtain the Application ID and Secret for your GitLab OAuth application.
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.
Navigate to App Connections
Navigate to the App Connections tab on the Organization Settings page.
Add Connection
Select the GitLab Connection option from the connection options modal.
Choose OAuth Method
Select the OAuth method and click Connect to GitLab.
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.
Connection Created
Your GitLab Connection is now available for use.