Add GitLab as an OAuth provider
This guide explains how to let users sign in to Casdoor with their account on GitLab.com or on a self-hosted GitLab instance.
Learning outcomes
- Create an OAuth application in GitLab.
- Add GitLab as an OAuth provider in Casdoor.
What you need
- A GitLab account
- Administrator access to the Casdoor admin console
Create the GitLab application
-
Open the Applications page of your profile. On a self-hosted GitLab, the page is
https://<your-gitlab>/-/profile/applications. -
Click Add new application.
-
Fill in the fields:
- Name: For example
Casdoor. - Redirect URI: The callback URL of Casdoor,
https://<your-casdoor-host>/callback. See Redirect URL and callback URL. - Scopes: Select at least
read_userandprofile. Without them, sign-in can fail.
- Name: For example
-
Save the application and copy the Application ID and the Secret.
Add the provider in Casdoor
- In the Casdoor admin console, go to Identity > Providers and add a provider.
- Set Category to
OAuthand Type toGitLab. - Enter the Application ID as the Client ID and the Secret as the Client secret.
- Save the provider.
Next steps
Add the provider to an application. See Add providers to an application.
See also
- OAuth providers
- GitLab integration: Sign users in to GitLab with Casdoor.