Skip to content

Commit

Permalink
feat(auth): allow custom GitLab endpoints for self-managed instances (r…
Browse files Browse the repository at this point in the history
…equarks#6399)

* Allow custom GitLab endpoints for self-hosting

---------

Co-authored-by: Nicolas Giard <[email protected]>
  • Loading branch information
DerekJarvis and NGPixel authored May 12, 2023
1 parent 5f2b42a commit f921133
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/modules/authentication/gitlab/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
10 changes: 10 additions & 0 deletions server/modules/authentication/gitlab/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f921133

Please sign in to comment.