Browse Source
feat(auth): allow custom GitLab endpoints for self-managed instances (#6399)
* Allow custom GitLab endpoints for self-hosting
---------
Co-authored-by: Nicolas Giard <github@ngpixel.com>
pull/6428/head
DerekJarvis
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
0 deletions
-
server/modules/authentication/gitlab/authentication.js
-
server/modules/authentication/gitlab/definition.yml
|
|
@ -15,6 +15,8 @@ module.exports = { |
|
|
|
clientSecret: conf.clientSecret, |
|
|
|
callbackURL: conf.callbackURL, |
|
|
|
baseURL: conf.baseUrl, |
|
|
|
authorizationURL: conf.authorizationURL || (conf.baseUrl + '/oauth/authorize'), |
|
|
|
tokenURL: conf.tokenURL || (conf.baseUrl + '/oauth/token'), |
|
|
|
scope: ['read_user'], |
|
|
|
passReqToCallback: true |
|
|
|
}, async (req, accessToken, refreshToken, profile, cb) => { |
|
|
|
|
|
@ -24,3 +24,13 @@ props: |
|
|
|
hint: For self-managed GitLab instances, define the base URL (e.g. https://gitlab.example.com). Leave default for GitLab.com SaaS (https://gitlab.com). |
|
|
|
default: https://gitlab.com |
|
|
|
order: 3 |
|
|
|
authorizationURL: |
|
|
|
type: String |
|
|
|
title: Authorization URL |
|
|
|
hint: For self-managed GitLab instances, define an alternate authorization URL (e.g. http://example.com/oauth/authorize). Leave empty otherwise. |
|
|
|
order: 4 |
|
|
|
tokenURL: |
|
|
|
type: String |
|
|
|
title: Token URL |
|
|
|
hint: For self-managed GitLab instances, define an alternate token URL (e.g. http://example.com/oauth/token). Leave empty otherwise. |
|
|
|
order: 5 |