
GitLab EE 인스턴스를 설정 중이며 Google 계정으로만 가입 프로세스를 활성화하고 싶습니다. 나는 여기 문서를 따랐습니다.https://docs.gitlab.com/ce/integration/google.html그리고 여기:https://docs.gitlab.com/ce/integration/omniauth.html.
기존 계정을 Google 계정에 연결하려고 시도했을 때 Google과의 통합은 문제 없이 잘 작동했습니다.
문제는 기존 계정 없이 Google을 사용하여 가입하려고 할 때 오류가 발생한다는 것입니다.
기존 GitLab 계정 없이 Google 계정을 사용하여 로그인하는 것은 허용되지 않습니다.
내 현재 /etc/gitlab/gitlab.rb
구성은 다음과 같습니다.
### OmniAuth Settings
###! Docs: https://docs.gitlab.com/ce/integration/omniauth.html
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['google_oauth2']
gitlab_rails['omniauth_sync_email_from_provider'] = 'google_oauth2'
gitlab_rails['omniauth_sync_profile_from_provider'] = ['google_oauth2']
gitlab_rails['omniauth_sync_profile_attributes'] = ['email', 'name', 'location']
gitlab_rails['omniauth_auto_sign_in_with_provider'] = 'google_oauth2'
gitlab_rails['omniauth_block_auto_created_users'] = false
# gitlab_rails['omniauth_auto_link_ldap_user'] = false
# gitlab_rails['omniauth_auto_link_saml_user'] = false
# gitlab_rails['omniauth_external_providers'] = ['google_oauth2']
gitlab_rails['omniauth_providers'] = [
{
"name" => "google_oauth2",
"app_id" => "my-app-id",
"app_secret" => "my-app-secret",
"args" => { "access_type" => "offline", "approval_prompt" => "" }
}
]
내가 도대체 뭘 잘못하고있는 겁니까? GitLab은 Google을 사용하여 가입할 수도 있나요?
답변1
구성을 약간 조정한 후 작동하는 설정을 찾았습니다.
### OmniAuth Settings
###! Docs: https://docs.gitlab.com/ce/integration/omniauth.html
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['google_oauth2']
# gitlab_rails['omniauth_sync_email_from_provider'] = 'google_oauth2'
gitlab_rails['omniauth_sync_profile_from_provider'] = ['google_oauth2']
# gitlab_rails['omniauth_sync_profile_attributes'] = ['email']
# gitlab_rails['omniauth_auto_sign_in_with_provider'] = 'google_oauth2'
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_auto_link_ldap_user'] = true
# gitlab_rails['omniauth_auto_link_saml_user'] = false
# gitlab_rails['omniauth_external_providers'] = ['google_oauth2']
gitlab_rails['omniauth_providers'] = [
{
"name" => "google_oauth2",
"app_id" => "<APP_ID>",
"app_secret" => "<APP_SECRET>",
"args" => { "access_type" => "offline", "approval_prompt" => "" }
}
]
답변2
구성에 대한 질문이 있습니다. 기존 사용자가 문제가 될까요? 이메일이 로컬 gitlab과 Google 작업 공간 모두에서 동일하면 잘 동기화됩니까?
주석 처리를 제거해야 합니까?
gitlab_rails['omniauth_sync_email_from_provider'] = 'google_oauth2'
그리고 이 줄이 없습니다. 그게 문제인가요?
gitlab_rails['omniauth_sync_profile_from_provider'] = ['google_oauth2']
기존 댓글, 사용자 등을 모두 망치고 싶지 않아서 질문드립니다!
친애하는