This set of samples shows how you can use passwordless authentication in your single page application. There are samples for both SMS and Email connections and both using the Auth0 Lock widget or a custom UI.
Single Page Passwordless samples include:
- Login with a one time code via sms using Lock
- Login with a one time code via email using Lock
- Login with a magic link via email using Lock
- Login with a one time code via sms using your own UI
- Login with a one time code via email using your own UI
- Login with a magic link via email using your own UI
You can read more about Passwordless Authentication on our Doc's Site, where you will find the complete Single Page App tutorials for:
- Authenticate users with a one time code via SMS
- Authenticate users with a one time code via Email
- Authenticate users with a magic link via Email
- Create an auth0-variables.js file with your Auth0 credentials. You can use auth0-variables.sample.js as a template. You can get the clientId and domain from the Auth0 Dashboard.
- In your App's configuration on the Auth0 Dashboard, add
http://localhost:3000
to the Allowed Origins (CORS) list in order for the one time code samples to work, and addhttp://localhost:3000/custom-magic-link.html, http://localhost:3000/lock-magic-link.html
to the Allowed Callback URLs list for the magic link samples to function. - Initialize a web server in the samples folder. You can do it for instance with
serve
:- Install node
- run
npm install -g serve
- run
serve
in the project's folder to start a server
- Go to the index page and select the scenario you want to try.
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when and where users are logging in.
- Pull data from other sources and add it to the user profile, through JavaScript rules.
- Go to Auth0 and click Sign Up.
- Use Google, GitHub or Microsoft Account to login.
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.