diff --git a/README.md b/README.md index bf1099cf..e7479d61 100644 --- a/README.md +++ b/README.md @@ -718,7 +718,7 @@ Also you can configure v2 endpoint (`azure_activedirectory_v2`) by using `OAUTH_ To enable the Generic OAuth2 provider, you must register your application with your provider. You also need to confirm OAuth2 provider app's ID and secret, the client options and the user's response structure. -As an example this code has been tested with Keycloak, with the following variables: `OAUTH2_GENERIC_APP_ID`, `OAUTH2_GENERIC_APP_SECRET`, `OAUTH2_GENERIC_CLIENT_SITE`, `OAUTH2_GENERIC_CLIENT_USER_INFO_URL`, `OAUTH2_GENERIC_CLIENT_AUTHORIZE_URL`, `OAUTH2_GENERIC_CLIENT_TOKEN_URL`, `OAUTH2_GENERIC_CLIENT_END_SESSION_ENDPOINT`, `OAUTH2_GENERIC_ID_PATH`, `OAUTH2_GENERIC_USER_UID`, `OAUTH2_GENERIC_USER_NAME`, `OAUTH2_GENERIC_USER_EMAIL`, `OAUTH2_GENERIC_NAME`, +As an example this code has been tested with Keycloak, with the following variables: `OAUTH2_GENERIC_APP_ID`, `OAUTH2_GENERIC_APP_SECRET`, `OAUTH2_GENERIC_CLIENT_SITE`, `OAUTH2_GENERIC_CLIENT_USER_INFO_URL`, `OAUTH2_GENERIC_CLIENT_AUTHORIZE_URL`, `OAUTH2_GENERIC_CLIENT_TOKEN_URL`, `OAUTH2_GENERIC_CLIENT_END_SESSION_ENDPOINT`, `OAUTH2_GENERIC_ID_PATH`, `OAUTH2_GENERIC_USER_UID`, `OAUTH2_GENERIC_USER_NAME`, `OAUTH2_GENERIC_USER_EMAIL`, `OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE`, `OAUTH2_GENERIC_LABEL` and `OAUTH2_GENERIC_NAME`. See [GitLab documentation](https://docs.gitlab.com/ee/integration/oauth2_generic.html#sign-into-gitlab-with-almost-any-oauth2-provider) and [Omniauth-oauth2-generic documentation](https://gitlab.com/satorix/omniauth-oauth2-generic) for more details. @@ -2279,6 +2279,14 @@ The OAuth2 generic user name. No defaults The OAuth2 generic user email. No defaults +##### `OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE` + +The scope of your OAuth2 provider. No defaults + +##### `OAUTH2_GENERIC_LABEL` + +The label of your OAuth2 provider. No defaults + ##### `OAUTH2_GENERIC_NAME` The name of your OAuth2 provider. No defaults diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 5754ad3c..35d4e4db 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -1017,6 +1017,8 @@ production: &base email: '{{OAUTH2_GENERIC_USER_EMAIL}}' } }, + authorize_params: { scope: "{{OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE}}" }, + label: '{{OAUTH2_GENERIC_LABEL}}', name: '{{OAUTH2_GENERIC_NAME}}' }} - { name: 'azure_oauth2', args: { diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index f2973490..fe49d61f 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -531,6 +531,8 @@ OAUTH2_GENERIC_ID_PATH=${OAUTH2_GENERIC_ID_PATH:-} OAUTH2_GENERIC_USER_UID=${OAUTH2_GENERIC_USER_UID:-} OAUTH2_GENERIC_USER_NAME=${OAUTH2_GENERIC_USER_NAME:-} OAUTH2_GENERIC_USER_EMAIL=${OAUTH2_GENERIC_USER_EMAIL:-} +OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE=${OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE:-} +OAUTH2_GENERIC_LABEL=${OAUTH2_GENERIC_LABEL:-} OAUTH2_GENERIC_NAME=${OAUTH2_GENERIC_NAME:-} ## ANALYTICS diff --git a/assets/runtime/functions b/assets/runtime/functions index a1607e2a..9deaa2fc 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -722,6 +722,8 @@ gitlab_configure_oauth2_generic() { OAUTH2_GENERIC_USER_UID \ OAUTH2_GENERIC_USER_NAME \ OAUTH2_GENERIC_USER_EMAIL \ + OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE \ + OAUTH2_GENERIC_LABEL \ OAUTH2_GENERIC_NAME else exec_as_git sed -i "/name: 'oauth2_generic'/,/{{OAUTH2_GENERIC_NAME}}/d" ${GITLAB_CONFIG} diff --git a/contrib/docker-swarm/docker-compose.yml b/contrib/docker-swarm/docker-compose.yml index 62fcd6c9..38145e48 100644 --- a/contrib/docker-swarm/docker-compose.yml +++ b/contrib/docker-swarm/docker-compose.yml @@ -163,6 +163,8 @@ services: - OAUTH2_GENERIC_USER_UID= - OAUTH2_GENERIC_USER_NAME= - OAUTH2_GENERIC_USER_EMAIL= + - OAUTH2_GENERIC_AUTHORIZE_PARAMS_SCOPE= + - OAUTH2_GENERIC_LABEL= - OAUTH2_GENERIC_NAME= - OAUTH_AZURE_API_KEY=