configuration
GitLab OAuth
Optional sign-in with GitLab. Separate from connecting personal accounts.
Glyph supports two unrelated GitLab integrations, mirroring GitHub:
- GitLab OAuth login - users sign into Glyph itself with their GitLab account
- Connected GitLab accounts (PAT) - users connect one or more GitLab accounts to import private projects
This page covers the first. For the second, see Connecting Accounts.
Creating the OAuth App
- Go to gitlab.com/-/profile/applications (or your self-hosted instance).
- Fill in:
- Name:
Glyph - Redirect URI:
http://localhost:8000/api/auth/gitlab/callback(yourAPP_URL+/api/auth/gitlab/callback) - Confidential: checked
- Scopes:
read_userandread_api
- Name:
- Click Save application.
- Copy the Application ID (this is your
GITLAB_CLIENT_ID). - Copy the Secret (this is your
GITLAB_CLIENT_SECRET).
Configuring Glyph
In your .env:
GITLAB_CLIENT_ID=<application id>
GITLAB_CLIENT_SECRET=<application secret>Restart the backend:
docker compose restart backendThe login page now shows a Sign in with GitLab button alongside GitHub (if both are configured).
Self-hosted GitLab
For a self-hosted GitLab instance, the OAuth flow targets your instance, not gitlab.com. The OAuth URLs are derived from gitlab.com by default - to change them, override the backend setting gitlab_oauth_url (currently requires a code change; future versions will expose this as an env var).
How sign-in works
Identical to GitHub:
- User clicks Sign in with GitLab
- GitLab consent screen appears
- Redirect to
APP_URL/api/auth/gitlab/callback?code=... - Backend exchanges the code, fetches the user, creates/matches a Glyph user
- JWT issued, user signed in
Production callback URL
When behind a reverse proxy:
- Update Redirect URI on gitlab.com to your public URL (e.g.
https://api.glyph.example.com/api/auth/gitlab/callback) - Update
APP_URLin.envto match
Both must match exactly.
Required scopes are read_user and read_api. Don't grant more - unnecessary scopes are a security risk if the OAuth secret leaks.
Disabling
Leave GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET empty. The login page hides the GitLab button.