GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 9282810f authored by Patricio Cano's avatar Patricio Cano

Syntax fixes and better logging around the `ldap_person` method.

parent c593154c
......@@ -70,15 +70,16 @@ def find_or_create_ldap_user
# If a corresponding person exists with same uid in a LDAP server,
# check if the user already has a GitLab account.
if (user = Gitlab::LDAP::User.find_by_uid_and_provider(ldap_person.dn, ldap_person.provider))
user = Gitlab::LDAP::User.find_by_uid_and_provider(ldap_person.dn, ldap_person.provider)
if user
# Case when a LDAP user already exists in Gitlab. Add the OAuth identity to existing account. "LDAP account found for user #{user.username}. Building new identity." "LDAP account found for user #{user.username}. Building new #{auth_hash.provider} identity." auth_hash.uid, provider: auth_hash.provider)
else 'No existing LDAP account was found in GitLab. Checking for OAuth account.' "No existing LDAP account was found in GitLab. Checking for #{auth_hash.provider} account."
user = find_by_uid_and_provider
if user.nil? 'No user found with the specified OAuth provider. Creating a new one.' "No user found using #{auth_hash.provider} provider. Creating a new one."
user = build_new_user
end "Correct account has been found. Adding LDAP identity to user: #{user.username}."
......@@ -184,9 +184,9 @@ def stub_saml_group_config(groups)
create(:omniauth_user, email: '', extern_uid: 'uid=user1,ou=People,dc=example', provider: 'saml', username: 'john')
local_hash = 'uid=user1,ou=People,dc=example', provider: provider, info: info_hash)
local_saml_user =
local_gl_user = local_saml_user.gl_user
expect(local_gl_user).to be_valid
expect(local_gl_user.identities.length).to eql 2
identities_as_hash = { |id| { provider: id.provider, extern_uid: id.extern_uid } }
......@@ -194,7 +194,6 @@ def stub_saml_group_config(groups)
{ provider: 'saml', extern_uid: 'uid=user1,ou=People,dc=example' }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment