-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
Should this have a config option to specify whether to even attempt using the |
The Travis build error is unrelated. |
This uses the oauth nickname, when present, as the username.
@randx What do you think? |
I like this one :D, it makes single-sing-on from github a lot more logical (since you keep the same username). |
@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. |
@jhollingsworth Sweet :D and thanks for the quick answer! |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblessing Ok thanks :-)
@jhollingsworth Can you please make it mergeable again? |
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. |
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.