跳到主内容

GitLab OAuth

Use the GitLab Applications page (or https://<your-gitlab>/-/profile/applications for self-hosted) to create an OAuth application.

Create the GitLab application

  1. Click Add new application.
  2. Set Name (e.g. "Casdoor"), Redirect URI, and Scopes.
注意事项

Enable scopes read_user and profile. Without them, authentication can fail.

信息

In GitLab, Redirect URI must be Casdoor’s callback URL. In Casdoor, the application Redirect URL is your application’s callback URL. See Application config.

  1. After creating the app, copy Application ID and Secret from the app details.

Add the provider in Casdoor

Create an OAuth provider, set Type to GitLab, and enter Application ID as Client ID and Secret as Client Secret.