Skip to content
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

SSO: Fallback to email if the username field is empty #1400

Merged
merged 3 commits into from
Jun 7, 2018

Conversation

sandrinodimattia
Copy link
Member

Description

Today when you have an enterprise connection configured and you type in an email address that matches the domain of this connection (eg: john@contoso.com => contoso.com), the login/signup/password reset pages will take that into account.

  • Login => will change to SSO mode
  • Signup => will change to SSO mode
  • Password Reset => will prevent you from changing your password with a message saying you need to contact your administrator

While this works fine for database connections, there is an issue when the database connection requires a username. With usernames required, the databaseUsernameValue method will only look at the username field. While this works for the login page, it does not for signup and password reset (because there you enter your email address ... in the email field). This currently results in:

  • Login => will change to SSO mode
  • Signup => will not change to SSO. instead the signup form is still shown.
  • Password Reset => will not show a warning.

This change will have databaseUsernameValue fallback to the email address if the username field is not filled in. With that, when an enterprise user accidentally fills in their corporate email address on the signup or password reset page, we will trigger the correct behavior of forcing them to use SSO (or preventing them to change their password).

Testing

The change has manually been tested. An account configured with a DB connection requiring a username + an enterprise connection now results in this behavior:

  • Login => will change to SSO mode
  • Signup => will change to SSO mode
  • Password Reset => will prevent you from changing your password with a message saying you need to contact your administrator

Unit tests were also added.

@luisrudge
Copy link
Contributor

@sandrinodimattia can I get you to write all my PR descriptions? 😍

@luisrudge luisrudge merged commit 080a049 into auth0:master Jun 7, 2018
@luisrudge luisrudge added this to the v11.7.2 milestone Jun 7, 2018
@luisrudge luisrudge changed the title Fallback to email if the username field is empty SSO: Fallback to email if the username field is empty Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants