Open nemonik opened 3 years ago
I think not documenting the need to set OAUTH2_GENERIC_NAME maybe the problem.
- name: OAUTH2_GENERIC_NAME
value: Keycloak
And you have to configure at least for me... as per Keycloak's Client Scopes.
- name: OAUTH2_GENERIC_USER_UID
value: "preferred_username"
- name: OAUTH2_GENERIC_USER_NAME
value: "name"
- name: OAUTH2_GENERIC_USER_EMAIL
value: "email"
I'll propose some edits to the doc... in a day or two... in a pull request.
Do not set OAUTH_EXTERNAL_PROVIDERS=Keycloak
as shown in the doc as your users will not be able to create projects... Their project limit will default to 0
.
Use
- name: OAUTH_EXTERNAL_PROVIDERS
value: ""
I authored a pull request addressing https://github.com/sameersbn/docker-gitlab/pull/2293
Thanks a lot @nemonik for improving this part of the documentation!
I also encounter an error (both sidekiq and puma exit with error code 1, with no log apparently) as soon as I set OAUTH2_GENERIC_APP_ID
.
And curiously happens even if I set OAUTH_ENABLED=false
.
Is there a workaround or something I can do to debug this issue?
@Kristaba, i have the same issue.
Without OAUTH2_GENERIC_APP_ID
i get an error 500 on login page, with it sidekiq and puma are stuck in a restart loop.
@Kristaba maybe this is overwriting your OAUTH_ENABLED?:
Enable OAuth support. Defaults to true if any of the support OAuth providers is configured, else defaults to false.
I some sort of this problem too, I configured my gitlab according to https://github.com/sameersbn/docker-gitlab/blob/master/docs/keycloak-idp.md
And there is no login button for Keycloak showing up.
I am using docker image version sameersbn/gitlab:14.9.3
and this is my OAUTH config:
- OAUTH_ENABLED=true
- OAUTH_ALLOW_SSO=Keycloak
- OAUTH_BLOCK_AUTO_CREATED_USERS=false
- OAUTH_AUTO_LINK_LDAP_USER=false
- OAUTH_AUTO_LINK_SAML_USER=false
- OAUTH2_GENERIC_APP_SECRET=my_token
- OAUTH2_GENERIC_CLIENT_SITE=https://auth.example.com
- OAUTH2_GENERIC_CLIENT_USER_INFO_URL=https://auth.example.com/auth/realms/example/protocol/openid-connect/userinfo
- OAUTH2_GENERIC_CLIENT_AUTHORIZE_URL=https://auth.example.com/auth/realms/example/protocol/openid-connect/auth
- OAUTH2_GENERIC_CLIENT_TOKEN_URL=https://auth.example.com/auth/realms/example/protocol/openid-connect/token
- OAUTH2_GENERIC_CLIENT_END_SESSION_ENDPOINT=https://auth.example.com/auth/realms/example/protocol/openid-connect/logout
- OAUTH2_GENERIC_USER_UID='preferred_username'
- OAUTH2_GENERIC_USER_NAME='name'
- OAUTH2_GENERIC_USER_EMAIL='email'
I even named the client
in Keycloak git
because the docs says it and I only can configure the ID
Any ideas? Thank you in advance!
EDIT: 15.04.2022
I got it working:
- OAUTH_ENABLED=true
- OAUTH_ALLOW_SSO=Keycloak
- OAUTH_BLOCK_AUTO_CREATED_USERS=false
- OAUTH_AUTO_LINK_LDAP_USER=false
- OAUTH_AUTO_LINK_SAML_USER=false
- OAUTH2_GENERIC_NAME=Keycloak
- OAUTH2_GENERIC_APP_SECRET=my_token
- OAUTH2_GENERIC_CLIENT_SITE=https://auth.example.com
- OAUTH2_GENERIC_CLIENT_USER_INFO_URL=https://auth.example.com/realms/example/protocol/openid-connect/userinfo
- OAUTH2_GENERIC_CLIENT_AUTHORIZE_URL=https://auth.example.com/realms/example/protocol/openid-connect/auth
- OAUTH2_GENERIC_CLIENT_TOKEN_URL=https://auth.example.com/realms/example/protocol/openid-connect/token
- OAUTH2_GENERIC_CLIENT_END_SESSION_ENDPOINT=https://auth.example.com/realms/example/protocol/openid-connect/logout
- OAUTH2_GENERIC_USER_UID='preferred_username'
- OAUTH2_GENERIC_USER_NAME='name'
- OAUTH2_GENERIC_USER_EMAIL='email'
Several things to watch out for:
OAUTH2_GENERIC_NAME
after initially set -> HTTP ERROR 422/auth
as suffix:
https://auth.example.com/auth/realms...
vs. https://auth.example.com/realms...
@BartJoris for sameersbn/gitlab:13.3.4 and following https://github.com/sameersbn/docker-gitlab/blob/master/docs/keycloak-idp.md guidance I am seeing the following error on start up. This occurs as soon as I add the OUTH2_GENERIC_APP_ID:
I am providing
Does a referenced docker-compose exist for what the document describes? Is it an additional configuration item? Something breaking in this release?