{"id":22782429,"url":"https://github.com/kdhttps/auth0-angular-node","last_synced_at":"2026-05-07T09:36:27.779Z","repository":{"id":38781097,"uuid":"177007778","full_name":"kdhttps/auth0-angular-node","owner":"kdhttps","description":"Auth0 authentication with Angular and NodeJS :rocket:","archived":false,"fork":false,"pushed_at":"2023-01-09T16:47:50.000Z","size":810,"stargazers_count":1,"open_issues_count":33,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T16:24:39.203Z","etag":null,"topics":["angular7","auth0","auth0-jwt","authentication","nodejs","openid-connect"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdhttps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-21T19:03:23.000Z","updated_at":"2021-12-13T01:43:03.000Z","dependencies_parsed_at":"2022-08-25T08:51:14.867Z","dependency_job_id":null,"html_url":"https://github.com/kdhttps/auth0-angular-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fauth0-angular-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fauth0-angular-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fauth0-angular-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fauth0-angular-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdhttps","download_url":"https://codeload.github.com/kdhttps/auth0-angular-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246333931,"owners_count":20760638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular7","auth0","auth0-jwt","authentication","nodejs","openid-connect"],"created_at":"2024-12-11T21:11:52.145Z","updated_at":"2025-10-09T20:20:20.589Z","avatar_url":"https://github.com/kdhttps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth0 Authentication\n\n\u003e Note: Not official support, Just love to contribute ;-)\n\nAuthentication with OAuth0 in Angular and NodeJS.\n\nBelow is the solution for to get Access Token as JWT and JWT verification with NodeJS.\n\n## JWT Access Token\n1. Need to use audience\n\n2. Configuration in angular app. All the keys are case sensitive. Use `environment.ts` file to store credentials.\n```\nauth0 = new auth0.WebAuth({\n    clientID: \u003cyour_client_id\u003e',\n    domain: '\u003cyour.auth0.com\u003e',\n    responseType: 'token id_token',\n    audience: 'https://\u003cyour.auth0.com\u003e/api/v2/',\n    redirectUri: 'http://localhost:4200/callback',\n    logoutRedirect: 'http://localhost:4200',\n    scope: 'openid profile email'\n});\n```\n\n3. Auth0 Client Configuration\n\n- Client settings\n\n![client](docs/client.png)\n\n- Audience URL\n\n![audience](docs/audience.png)\n\n### Notes\n\n1. If you want access token as JWT then you must have to set audience.\n2. Set APIs https://\u003cyour.auth0.com\u003e/api/v2/ in audience as given above example. Userinfo endpoint not working for me.\n3. In the URL / is required at last. https://\u003cyour.auth0.com\u003e/api/v2/\n4. Node side JWT verification\n```\nconst authCheck = jwt({\n    secret: jwks.expressJwtSecret({\n        cache: true,\n        rateLimit: true,\n        jwksRequestsPerMinute: 5,\n        jwksUri: 'https://\u003cyour.auth0.com\u003e/.well-known/jwks.json'\n    }),\n    // This is the identifier we set when we created the API\n    audience: 'https://\u003cyour.auth0.com\u003e/api/v2/',\n    issuer: 'https://\u003cyour.auth0.com\u003e/',\n    algorithms: ['RS256']\n});\n```\n5. In the URL / is required at last. https://\u003cyour.auth0.com\u003e/api/v2/ and https://\u003cyour.auth0.com\u003e/\n\n## Get Roles in Userinfo\n\n1. Add roles and assign roles to users using auth0 dashboard.\n\n2. Add rules in your auth0. \n```\nfunction (user, context, callback) {\n\n  // Roles should only be set to verified users.\n  if (!user.email || !user.email_verified) {\n    return callback(null, user, context);\n  }\n\n  user.app_metadata = user.app_metadata || {};\n  user.app_metadata.roles = context.authorization.roles;\n  auth0.users.updateAppMetadata(user.user_id, user.app_metadata)\n    .then(function () {\n      context.idToken['https://example.com/roles'] = user.app_metadata.roles;\n      callback(null, user, context);\n    })\n    .catch(function (err) {\n      callback(err);\n    });\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdhttps%2Fauth0-angular-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdhttps%2Fauth0-angular-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdhttps%2Fauth0-angular-node/lists"}