auto-creating users via omniauth can fail if unique attributes (e.g. username, email) are already taken in gitlab
copied from https://github.com/gitlabhq/gitlabhq/issues/5495
|Generated GitLab username||john.doe||john.doe||foo.bar|
John Doe can be the same person, but also it can be two different persons with the same first and last name the behaviour will be the same.
- When John Doe from realm1 logs into GitLab, it creates username john.doe by parsing first part of his email address.
- When John Doe from realm2 now tries to log into GitLab it will get error 422 and production log will have an entry like this:
ActiveRecord::RecordInvalid (Validation failed: Username has already been taken, Username already exist):
- When Foo Bar logs in it will be successfully created since his email is unique and username still doesn't exist for provider shibboleth.