Skip to content

OAuth nickname to username #5884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

OAuth nickname to username #5884

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 19, 2013

This uses the oauth nickname, when present, as the username.

Fix for issue #5813.
Replaces PR #5824.

For LDAP to work as expected, requires gitlabhq/omniauth-ldap#7 to be merged.

@ghost ghost mentioned this pull request Dec 19, 2013
@ghost
Copy link
Author

ghost commented Dec 20, 2013

Should this have a config option to specify whether to even attempt using the nickname?

@ghost
Copy link
Author

ghost commented Jan 2, 2014

The Travis build error is unrelated.

This uses the oauth nickname, when present, as the username.
@jvanbaarsen
Copy link
Contributor

@randx What do you think?

@omkelderman
Copy link
Contributor

I like this one :D, it makes single-sing-on from github a lot more logical (since you keep the same username).
One question though, ive figured out the nickname-thing myself, so i edited user.rb myself. Then i came across this page. Should i worry about the fact that i havent edited those other two files?? (ive absolutely no idea what the function of those files is:P)

@ghost
Copy link
Author

ghost commented Mar 2, 2014

@omkelderman The other two files are for tests. If you aren't doing GitLab development or running the tests, you don't need to worry about the other files.

@omkelderman
Copy link
Contributor

@jhollingsworth Sweet :D and thanks for the quick answer!

@jvanbaarsen
Copy link
Contributor

The dependency is met via: gitlabhq/omniauth-ldap#10

@@ -58,7 +58,7 @@ def name
end

def username
email.match(/^[^@]*/)[0]
(auth.info.nickname || email.match(/^[^@]*/)[0]).downcase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if auth.info is not present?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth.info should always exist in omniauth. See https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblessing Ok thanks :-)

@jvanbaarsen
Copy link
Contributor

@jhollingsworth Can you please make it mergeable again?

@jvanbaarsen
Copy link
Contributor

This merge request has been closed because a request for more information has not been reacted to for more than 2 weeks. If you respond and conform to the merge request guidelines in our contributing guidelines we will reopen this merge request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants