bitsmuggler / auth0-angular-authentication-example

Auth0 Angular Example (Authorization Code Grant)

Home Page:https://auth0-angular-authentication-example.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth0 Angular Example (Authorization Code Flow)

Netlify Status

This example shows Auth0 client authentication with Angular. It's the Authorization Code Flow.

👉 Demo

👉 Under the hood Authorization Code Grant

Configuration Auth0

  • Register and setup your tenant
  • Create an application Applications > Create Application > Type "Single Page Web Applications"
  • Set the following attributes
    • Allowed Callback URLs: http://localhost:4200
    • Allowed Logout URLs: http://localhost:4200
    • Allowed Web Origins: http://localhost:4200

Configuration Angular App

  • Edit environment.ts
    • auth0ClientDomainto app domain (Application Settings > Basic Information > Domain)
    • auth0ClientId to app client id (Application Settings > Basic Information > Client Id)

Run it

  • Install dependencies npm install (+ probably the ng cli npm install -g @angular/cli or run the serve commandvia npx)
  • Run ng serve

Resources

About

Auth0 Angular Example (Authorization Code Grant)

https://auth0-angular-authentication-example.netlify.app/


Languages

Language:TypeScript 85.6%Language:JavaScript 10.1%Language:HTML 3.9%Language:CSS 0.4%