{"id":15046658,"url":"https://github.com/auth0/passport-auth0","last_synced_at":"2025-05-14T07:08:11.344Z","repository":{"id":5494457,"uuid":"6692957","full_name":"auth0/passport-auth0","owner":"auth0","description":"Auth0 authentication strategy for Passport.js","archived":false,"fork":false,"pushed_at":"2025-03-28T17:39:53.000Z","size":302,"stargazers_count":299,"open_issues_count":1,"forks_count":93,"subscribers_count":123,"default_branch":"master","last_synced_at":"2025-04-11T01:41:57.116Z","etag":null,"topics":["dx-sdk","passport"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/auth0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-11-14T18:56:02.000Z","updated_at":"2025-04-04T02:12:46.000Z","dependencies_parsed_at":"2023-01-13T13:33:59.017Z","dependency_job_id":"8cccd804-2103-461e-8d92-2881ea48c8d9","html_url":"https://github.com/auth0/passport-auth0","commit_stats":{"total_commits":175,"total_committers":51,"mean_commits":"3.4313725490196076","dds":0.8228571428571428,"last_synced_commit":"dfc1d20fc63e948a5766330c9e8575b3e2385b4c"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fpassport-auth0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fpassport-auth0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fpassport-auth0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fpassport-auth0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/passport-auth0/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092656,"owners_count":22013290,"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":["dx-sdk","passport"],"created_at":"2024-09-24T20:53:20.963Z","updated_at":"2025-05-14T07:08:11.322Z","avatar_url":"https://github.com/auth0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Auth0 authentication strategy for Passport.js](https://cdn.auth0.com/website/sdks/banners/passport-auth0-banner.png)\n\nThe [Auth0](https://auth0.com/) authentication strategy for [Passport.js](http://passportjs.org/), an authentication middleware for Node.js that can be unobtrusively dropped into any Express-based web application.\n\n[![Release](https://img.shields.io/npm/v/passport-auth0)](https://npmjs.org/package/passport-auth0)\n[![npm](https://img.shields.io/npm/dm/passport-auth0)](https://npmjs.org/package/passport-auth0)\n[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![CircleCI](https://img.shields.io/circleci/build/github/auth0/passport-auth0)](https://circleci.com/gh/auth0/passport-auth0)\n\n:books: [Documentation](#documentation) - :rocket: [Getting Started](#getting-started) - :speech_balloon: [Feedback](#feedback)\n\n## Documentation\n\n- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.\n\n\n## Getting started\n\u003e :information_source:  **Maintenance Advisory:**  With the release of https://github.com/auth0/express-openid-connect, we will no longer be adding new features to this library, however we will continue to maintain this library and fix issues.  You can read more about the release of our new library at https://auth0.com/blog/auth0-s-express-openid-connect-sdk/\n\n### Installation\n\nThe Auth0 Passport strategy is installed with npm. \n\n```\nnpm install passport-auth0\n```\n\n### Customization\n\n#### State parameter\n\nThe Auth0 Passport strategy enforces the use of the `state` parameter in OAuth 2.0 [authorization requests](https://tools.ietf.org/html/rfc6749#section-4.1.1) and requires session support in Express to be enabled.\n\nIf you require the `state` parameter to be omitted (which is not recommended), you can suppress it when calling the Auth0 Passport strategy constructor:\n\n```js\nconst Auth0Strategy = require('passport-auth0');\nconst strategy = new Auth0Strategy({\n     // ...\n     state: false\n  },\n  function(accessToken, refreshToken, extraParams, profile, done) {\n    // ...\n  }\n);\n```\n\n[More on state handling here](https://github.com/auth0/passport-auth0/issues/40#issuecomment-511592801).\n\n#### Scopes\n\nIf you want to change the scope of the ID token provided, add a `scope` property to the authenticate configuration passed when defining the route. These must be [OIDC standard scopes](https://auth0.com/docs/scopes/current/oidc-scopes). If you need data outside of the standard scopes, you can add [custom claims](https://auth0.com/docs/scopes/current/custom-claims) to the token.\n\n```js\napp.get(\n\t'/login',\n\tpassport.authenticate('auth0', {scope: 'openid email profile'}), \n\tfunction (req, res) {\n\t\tres.redirect('/');\n\t}\n);\n```\n\n#### Force a Specific IdP\n\nIf you want to force a specific identity provider you can use:\n\n```js\napp.get(\n\t'/login/google',\n\tpassport.authenticate('auth0', {connection: 'google-oauth2'}), \n\tfunction (req, res) {\n\t\tres.redirect('/');\n\t}\n);\n```\n\nIf you force an identity provider you can also request custom scope from that identity provider:\n\n```js\napp.get(\n\t'/login/google', \n\tpassport.authenticate('auth0', {\n\t\tconnection: 'google-oauth2',\n\t\tconnection_scope: 'https://www.googleapis.com/auth/analytics, https://www.googleapis.com/auth/contacts.readonly'\n\t}), \n\tfunction (req, res) {\n\t\tres.redirect('/');\n\t}\n);\n```\n\n#### Getting Access Tokens\n\nIf you want to specify an audience for the returned `access_token` you can:\n\n```js\napp.get(\n\t'/login',\n\tpassport.authenticate('auth0', {audience: 'urn:my-api'}), \n\tfunction (req, res) {\n\t  res.redirect('/');\n\t}\n);\n```\n\n#### Silent Authentication\n\nIf you want to check authentication without showing a prompt:\n\n```js\napp.get(\n\t'/login',\n\tpassport.authenticate('auth0', {prompt: 'none'}), \n\tfunction (req, res) {\n\t\tres.redirect('/');\n\t}\n);\n```\n\n## Feedback\n\n### Contributing\n\nWe appreciate feedback and contribution to this repo! Before you get started, please see the following:\n\n- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)\n- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)\n\n### Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/passport-auth0/issues).\n\n### Vulnerability Reporting\n\nPlease do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\"   width=\"150\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\"\u003e\n    \u003cimg alt=\"Auth0 Logo\" src=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eAuth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout \u003ca href=\"https://auth0.com/why-auth0\"\u003eWhy Auth0?\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\nThis project is licensed under the MIT license. See the \u003ca href=\"./LICENSE\"\u003e LICENSE\u003c/a\u003e file for more info.\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fpassport-auth0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fpassport-auth0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fpassport-auth0/lists"}