Casdoor can use the OIDC protocol to link to self-deployed GitLab server, and this document will show you how to do it.
The following are some of the names in the configuration:
CASDOOR_HOSTNAME: Domain name or IP where Casdoor server is deployed. e.g.,
GITLAB_HOSTNAME: Domain name or IP where GitLab is deployed. e.g.,
Step1. Deploy Casdoor and GitLab
After a successful deployment, you need to ensure:
- Casdoor can be logged in and used normally.
- Set Casdoor's
originvalue (conf/app.conf) to
Step2. Configure Casdoor application
- Create or use an existing Casdoor application.
- Add a redirect url:
- Add provider you want and supplement other settings.
Not surprisingly, you can get two values on the application settings page:
Client ID and
Client secret like the picture above, we will use them in next step.
Open your favorite browser and visit: http://
CASDOOR_HOSTNAME/.well-known/openid-configuration, you will see the OIDC configure of Casdoor.
Step3. Configure GitLab
You can follow the steps below to set this up, or make custom changes according to this document(e.g., you are installing GitLab using source code rather than Omnibus).
- On your GitLab server, open the configuration file.
sudo editor /etc/gitlab/gitlab.rb
- Add the provider configuration. (HOSTNAME url should include http or https)
gitlab_rails['omniauth_providers'] = [
label: "Casdoor", # optional label for login button, defaults to "Openid Connect"
scope: ["openid", "profile", "email"],
identifier: "<YOUR CLIENT ID>",
secret: "<YOUR CLIENT SECRET>",
- Reboot your GitLab server.
- Each registered user can open
GITLAB_HOSTNAME/-/profile/account, connect the casdoor account.
- Finish. Now, you can login your own GitLab by casdoor.