From c8bc43b9142fb817fb63cc388fb7af7cdf876f83 Mon Sep 17 00:00:00 2001 From: massej Date: Sun, 1 Oct 2023 13:40:45 -0400 Subject: [PATCH 1/6] Added missing label and scope variable field. --- assets/runtime/config/gitlabhq/gitlab.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 49502277..cdb7a805 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: { From af693c5ecc09f0ae02924ec6b8b51938e1eab177 Mon Sep 17 00:00:00 2001 From: massej Date: Sun, 1 Oct 2023 13:44:28 -0400 Subject: [PATCH 2/6] Update env-defaults --- assets/runtime/env-defaults | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index deab8a2a..e13db5fe 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 From a903d9829066671b8384d66c564b53251233a05e Mon Sep 17 00:00:00 2001 From: massej Date: Sun, 1 Oct 2023 13:45:02 -0400 Subject: [PATCH 3/6] Update functions --- assets/runtime/functions | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/runtime/functions b/assets/runtime/functions index 496a28e0..7febb24c 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} From fa75409aff25ccf4371e6e83b8857272c2f2aff6 Mon Sep 17 00:00:00 2001 From: massej Date: Sun, 1 Oct 2023 13:48:54 -0400 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e4578ef..ff5d89db 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. From ab0e2e63f8d177e44d1de0d0bd3b1f0cd5ae6a01 Mon Sep 17 00:00:00 2001 From: massej Date: Sun, 1 Oct 2023 13:49:47 -0400 Subject: [PATCH 5/6] Update docker-compose.yml --- contrib/docker-swarm/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) 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= From 8bcb068cacfc6b29828d09795c9e9d9492bcc8c3 Mon Sep 17 00:00:00 2001 From: massej Date: Mon, 2 Oct 2023 09:00:08 -0400 Subject: [PATCH 6/6] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index ff5d89db..15c4df89 100644 --- a/README.md +++ b/README.md @@ -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