-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable and disable oauth2 providers with environment variables #1177
Conversation
Thanks for the contribution! |
@oyarzun @zackgalbreath Sorry to hijack this merged MR, but just have to ask: How would I enable OAuth2 via GitLab if running using docker-compose? I'm attempting to put services:
cdash:
environment:
OAUTH2_PROVIDERS: |
[
'GitLab' => [
'clientId' => '<redacted>',
'clientSecret' => '<redacted>',
'redirectUri' => 'https://cdash.<ourdomain>/auth/GitLab.php',
'domain' => 'https://git.<ourdomain>'
]
] in our docker-compose.yml, but it doesn't seem to be working. There's no "log in via GitLab" or similar on the login page. |
Bah nevermind. That's precisely what this PR is about. I just had to add GITLAB_ENABLE=1 as well. |
However, with services:
cdash:
environment:
GITLAB_ENABLE: 1
OAUTH2_PROVIDERS: |
[
'GitLab' => [
'clientId' => '<redacted>',
'clientSecret' => '<redacted>',
'redirectUri' => 'https://cdash.<ourdomain>/auth/GitLab.php',
'domain' => 'https://git.<ourdomain>'
]
] I'm getting this backtrace:
Is it not possible to inject the OAUTH2_PROVIDERS variable in this way? |
Ah removing OAUTH2_PROVIDERS altogether and instead using GITLAB_ENABLE: 1
GITLAB_CLIENT_ID: <redacted>
GITLAB_CLIENT_SECRET: <redacted>
GITLAB_DOMAIN: https://git.<ourdomain> got me somewhere. However, when CDash makes the request to GitLab, it seems to use a HTTP URL as the
Note the http in the redirect_uri parameter. It needs to be https. |
And hm, even trying that redirect_url manually, but changing to https, I get a 500:
|
Thanks @oyarzun, I'll have a go. |
This PR adds environment variables to control whether an oauth2 provider is enabled. See #958 (comment)