Commit Graph

11 Commits

Author SHA1 Message Date
bdd5a0de33 Handle OAuth providers that return NULL for first or last name
We already handled those that returns empty, but it appears that at
least Microsoft can also return null/None. If those show up, just treat
them as empty.
2018-07-04 19:41:26 +02:00
4ca26d7646 Fix string vs variable in uncommon codepath 2018-06-29 13:40:04 +02:00
022dd26283 Enforce lowercase email addresses in more places
We don't want two different accounts to exist with the same email
address only differing in case. This had already happened for a few
which have been manually fixed, since it turns out we only enforced the
rule on new account creation, not when accounts changed email address or
when they were created using oauth. Also add database level constraints to
make sure this cannot happen again if some codepath is missed.
2017-10-13 14:09:22 +02:00
c0e4ef42ba Don't crash on completely empty github names
Sometimes you get a name but it's NULL, sometimes you don't get one. Yay
for consistency, but handle both cases.
2017-09-18 18:31:48 +02:00
1b6d047610 Add nicer exception handling for OAuth logins
Instead of throwing Internal Server Error at the user, throw a custom
exception that can actually give a slightly less useless error message.
2017-08-31 10:00:40 +02:00
87657036cc Make full name optional in all authentication providers
We haven't seen crashes for other providers, but that's no reason not to
fix..
2017-08-31 09:56:38 +02:00
c28b14e841 Don't crash when oauth provider does not include state
This should normally never happen, and should cause an error. But it
should cause an error saying "invalid state received", not an error
saying kaboom.
2017-08-31 09:37:28 +02:00
051c76e5b8 Further fixes for Github names with just one name
Not only can they be without names, they can be a one word name which
would cause a different crash. Again, allow that through and let the
user make manual adjustments if they wish.
2017-08-31 09:25:04 +02:00
ba28a9ca76 Support login with github profiles that have no full name
We only really need the email, the rest the user can just fill out
manually. So instead of crashing, just leave them empty.
2017-08-31 09:22:32 +02:00
d0f226a06d Give better error message when restricting information in oauth login
We need access to email, firstname and lastname, which is also what we
ask for. If the user forcibly restricts access to that, give a
reasonable error message instead of crashing.
2017-08-28 17:16:26 +02:00
9a77d1747a Implement support for Oauth2 based login integrations
This creates Google, Github, Microsoft and Facebook login integrations.
Other providers can also be added if needed. Accounts still need to be
created in the community auth system, and will be automatically created
on first login, when the user also gets to pick a username. Once an
account exists, it will be matched on email address from the external
systems.

No methods are enabled by default, as they all require encryption keys
and identities configured in local_settings.py.

Review by Stephen Frost, Jonathan Katz and Daniel Gustafsson.
2017-08-28 16:31:57 +02:00