Customer wanted for users to have 4 login options.
- Email password
- Username password
- Email passwordless
- SMS passwordless
I enabled both Database and Passwordless connections. After signup (where user was created in Database connection with email and username) in post-login action I’m creating user in Passwordless connection with email and another one with phone (collected in Auth0 form), then merge all three users into one and this way I have user that can log in with all 4 requested methods.
PROBLEM: switch between password and passwordless login screens.
When using passwordless we have to use Identifier first authentication profile. Login method is set up in connection query parameter to /authorize endpoint.
/authorize?connection=email - login passwordless with email
/authorize?connection=sms - login passwordless with sms
/authorize - login with password
Then we end up in /u/login/identifier?state=. If, for example, we modify this url to /u/signup/identifier?state= (no changes to state query parameter) user will be able to signup - easy-peasy. But there is nothing similar for redirecting to passwordless login screens. I’m not quite sure where Auth0 stores information of what screen to display (probably on the server and uses state or part of it as a key).
I made it work with double redirection. Email Me a Code button redirects to customer’s site with additional parameter e.g. https://site.com/auth0_redirect=1&connection=email, I handle this parameter, generate & store new state and nonce and redirect to /authorize?connection=emal. Same with sms. And text on buttons is hardcoded in a template for each login screen.
But now Auth0 is used as SSO on the platform customer moved to. Login with password works as expected. But on that platform I only have button that redirects to the login screen, I can’t specify parameters. Also from login screen I can redirect back to platform, but there I can’t handle query parameters in any way.
QUESTIONS:
- Are there ways to switch password and passwordless login screens (other then what I described).
- Where does Auth0 put that
connectionparameter when redirects to/u/login/identifier?state=? If I have more understanding maybe I will find other ways. - Can ACUL help me with that switching between login screens?
