This sample demonstrates authentication with Auth0 in an Ionic Angular application.
Build the sample:
npm run build
- Go to Auth0 and click Sign Up.
- Use Google, GitHub, or Microsoft Account to login.
You will need to create a Single Page Application using the Auth0 Dashboard. This will give you a Domain, Client ID, and Client Secret you will need below.
Your project needs to be configured with your Auth0 Domain and Client ID for the authentication flow to work. These values can be retrieved from the settings page of your Auth0 application.
Copy src/app/auth.config.ts.example
into a new file in the same folder called auth.config.ts
, and replace the values with your Auth0 application credentials:
export const domain = '{DOMAIN}';
export const clientId = '{CLIENT_ID}';
If running on a mobile device, add the following to your Allowed Callback URLs settings:
com.auth0.samples://{DOMAIN}/capacitor/com.auth0.samples/callback
If running on a mobile device, add the following to your Allowed Logout URLs settings:
com.auth0.samples://{DOMAIN}/capacitor/com.auth0.samples/callback
If running on a mobile device, add the following to your Allowed Origins (CORS) settings:
capacitor://localhost, http://localhost
If running on a desktop browser, add the following to your Allowed Callback URLs settings:
http://localhost:4200
If running on a desktop browser, add the following to your Allowed Logout URLs settings:
http://localhost:4200
If running on a desktop browser, add the following to your Allowed Web Origins settings:
http://localhost:4200
Start the app in your local browser:
npm start
Sync assets and run:
# ios
npx cap run ios
# android
npx cap run android
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 log in.
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.