Learn how to set up OAuth with GitLab.
To configure your global GitLab OAuth setup, you’ll need three pieces of information: a Redirect URI, a GitLab Client ID, and a GitLab Client Secret.
WorkOS provides the Redirect URI, an allowlisted callback URL. It indicates the location to return an authorized user to after both an authorization code is granted, and the authentication process is complete.
Open your WorkOS Dashboard and browse to the Authentication section on the left hand navigation bar. Scroll down to the GitLab OAuth section and click Enable.
In the modal, you’ll see the Redirect URI as well as the fields you’ll populate later with information from GitLab. This URI will be used as part of the registration process later in the GitLab developer settings page.
In order to integrate you’ll need the GitLab Client ID and the GitLab Client Secret.
These are a pair of credentials provided by GitLab that you’ll use to authenticate your application via the OAuth protocol. To obtain them:
Log in to your GitLab account and create a new application.
On the left sidebar, select your avatar. Select Edit profile.
On the left sidebar, select Applications. Select Add new application.
You can also register a new application under a group, which may be more appropriate if it is maintained by a team of developers, or instance-wide if you have a dedicated GitLab instance. For more on this see the GitLab docs.
Fill out the form with relevant details about your application, like the application name.
For Redirect URI, use the Redirect URI from the GitLab OAuth configuration modal in the WorkOS Dashboard.
The Confidential flag is enabled by default. It should be exclusively used by a trusted backend server that can securely store the client secret. For native-mobile, single-page, or other JavaScript applications, disable this flag.
Select the scopes for this app and click on Save application.
On the next page, you will see the GitLab Application ID and Secret for your new OAuth application.
Copy the Application ID and Secret and click Continue.
In the next step, you will provide both the GitLab Application ID and Secret to the WorkOS dashboard.
Go back to the Authentication section in the WorkOS Dashboard, and click on Edit under GitLab OAuth.
Toggle Enabled on and provide the client credentials from GitLab that you generated in the previous step.
Finally, click Save.
You are now ready to start authenticating with GitLab OAuth. Your users will see the option to sign-in with GitLab when visiting your AuthKit domain.