Add support of google_oauth2 with multiple google accounts.

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

If a company has multiple Gsuite organizations (i. e. @company2.com @company2.com).

The following snippet works, but on the log-in page, the button only for the first organization is visible.

gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['google_oauth2']
gitlab_rails['omniauth_sync_profile_from_provider'] = ['google_oauth2']
gitlab_rails['omniauth_sync_profile_attributes'] = ['email', 'name']
gitlab_rails['omniauth_block_auto_created_users'] = true

gitlab_rails['omniauth_providers'] = [
{
"name" => "google_oauth2",
"label" => "orgatisation_1",
"app_id" => "app_id_1",
"app_secret" => "app_secret_1",
"args" => { "access_type" => "offline", "approval_prompt" => "" }
},
{
"name" => "google_oauth2",
"label" => "organisation_2",
"app_id" => "app_id_2",
"app_secret" => "app_secret_2",
"args" => { "access_type" => "offline", "approval_prompt" => "" }
}
]

Screenshot_from_2021-12-10_18-43-39

Edited by 🤖 GitLab Bot 🤖