{"id":13526181,"url":"https://github.com/auth0/express-openid-connect","last_synced_at":"2026-01-12T08:18:35.323Z","repository":{"id":37382175,"uuid":"156774708","full_name":"auth0/express-openid-connect","owner":"auth0","description":"An Express.js middleware to protect OpenID Connect web applications.","archived":false,"fork":false,"pushed_at":"2025-03-18T13:14:50.000Z","size":2879,"stargazers_count":489,"open_issues_count":25,"forks_count":149,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-10T22:35:00.530Z","etag":null,"topics":["dx-sdk","openid","openid-connect"],"latest_commit_sha":null,"homepage":"","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":"CONTRIBUTING.md","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":"2018-11-08T22:02:14.000Z","updated_at":"2025-04-08T20:08:26.000Z","dependencies_parsed_at":"2023-02-13T20:46:08.786Z","dependency_job_id":"b5365b9b-d7bf-4cfb-ad44-537f31a9b68e","html_url":"https://github.com/auth0/express-openid-connect","commit_stats":{"total_commits":456,"total_committers":41,"mean_commits":"11.121951219512194","dds":0.7587719298245614,"last_synced_commit":"7dbc3b48aff13b6eb93a32306d40b0de2e802a8d"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fexpress-openid-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fexpress-openid-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fexpress-openid-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fexpress-openid-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/express-openid-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069219,"owners_count":22009512,"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","openid","openid-connect"],"created_at":"2024-08-01T06:01:26.171Z","updated_at":"2026-01-12T08:18:35.317Z","avatar_url":"https://github.com/auth0.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Developer Ecosystem"],"sub_categories":[],"readme":"![Express JS middleware implementing sign on for Express web apps using OpenID Connect.](https://cdn.auth0.com/website/sdks/banner/express-openid-connect-banner.png)\n\n![Release](https://img.shields.io/npm/v/express-openid-connect)\n[![Codecov](https://img.shields.io/codecov/c/github/auth0/express-openid-connect)](https://codecov.io/gh/auth0/express-openid-connect)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/express-openid-connect)\n![Downloads](https://img.shields.io/npm/dw/express-openid-connect)\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/express-openid-connect)\n\n📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💻 [API Reference](#api-reference) - 💬 [Feedback](#feedback)\n\n## Documentation\n\n- [Quickstart](https://auth0.com/docs/quickstart/webapp/express) - our guide for quickly adding Auth0 to your Express app.\n- [Sample](https://github.com/auth0-samples/auth0-express-webapp-sample/tree/master/01-Login) - an Express app integrated with Auth0.\n- [FAQs](https://github.com/auth0/express-openid-connect/blob/master/FAQ.md) - Frequently asked questions about express-openid-connect.\n- [Docs Site](https://auth0.com/docs) - explore our docs site and learn more about Auth0.\n\n## Getting Started\n\n### Requirements\n\nThis library supports the following tooling versions:\n\n- Node.js `^10.19.0 || \u003e=12.0.0`\n\n## Install\n\nUsing [npm](https://npmjs.org) in your project directory, run the following command:\n\n```bash\nnpm install express-openid-connect\n```\n\n## Getting Started\n\nFollow our [Secure Local Development guide](https://auth0.com/docs/libraries/secure-local-development) to ensure that applications using this library are running over secure channels (HTTPS URLs). Applications using this library without HTTPS may experience \"invalid state\" errors.\n\n### Configure Auth0\n\nCreate a **Regular Web Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).\n\n\u003e **If you're using an existing application**, verify that you have configured the following settings in your Regular Web Application:\n\u003e\n\u003e - Click on the \"Settings\" tab of your application's page.\n\u003e - Ensure that \"Authentication Methods\" setting in the \"Credentials\" tab is set to \"None\"\n\u003e - Scroll down and click on the \"Show Advanced Settings\" link.\n\u003e - Under \"Advanced Settings\", click on the \"OAuth\" tab.\n\u003e - Ensure that \"JsonWebToken Signature Algorithm\" is set to `RS256` and that \"OIDC Conformant\" is enabled.\n\u003e   Next, configure the following URLs for your application under the \"Application URIs\" section of the \"Settings\" page:\n\n- **Allowed Callback URLs**: `http://localhost:3000`\n- **Allowed Logout URLs**: `http://localhost:3000`\n\n\u003e These URLs should reflect the origins that your application is running on. **Allowed Callback URLs** may also include a path, depending on where you're handling the callback (see below).\n\nTake note of the **Client ID** and **Domain** values under the \"Basic Information\" section. You'll need these values in the next step.\n\n### Configuring the SDK\n\nThe library needs [issuerBaseURL](https://auth0.github.io/express-openid-connect/interfaces/ConfigParams.html#issuerbaseurl), [baseURL](https://auth0.github.io/express-openid-connect/interfaces/ConfigParams.html#baseurl), [clientID](https://auth0.github.io/express-openid-connect/interfaces/ConfigParams.html#clientid) and [secret](https://auth0.github.io/express-openid-connect/interfaces/ConfigParams.html#secret) to request and accept authentication. These can be configured with environmental variables:\n\n```text\nISSUER_BASE_URL=https://YOUR_DOMAIN\nCLIENT_ID=YOUR_CLIENT_ID\nBASE_URL=https://YOUR_APPLICATION_ROOT_URL\nSECRET=LONG_RANDOM_VALUE\n```\n\n... or in the library initialization:\n\n```js\n// index.js\n\nconst { auth } = require('express-openid-connect');\napp.use(\n  auth({\n    issuerBaseURL: 'https://YOUR_DOMAIN',\n    baseURL: 'https://YOUR_APPLICATION_ROOT_URL',\n    clientID: 'YOUR_CLIENT_ID',\n    secret: 'LONG_RANDOM_STRING',\n    idpLogout: true,\n  })\n);\n```\n\nWith this basic configuration, your application will require authentication for all routes and store the user identity in an encrypted and signed cookie.\n\n### Error Handling\n\nErrors raised by this library are handled by the [default Express error handler](https://expressjs.com/en/guide/error-handling.html#the-default-error-handler) which, in the interests of security, does not include the stack trace or error message in the production environment. If you write your own error handler, you should not render the error message or the OAuth `error`/`error_description` properties without using a templating engine that will properly escape them first.\n\nTo write your own error handler, see the Express documentation on writing [Custom error handlers](https://expressjs.com/en/guide/error-handling.html#writing-error-handlers).\n\nFor other comprehensive examples such as route-specific authentication, custom application session handling, requesting and using access tokens for external APIs, and more, see the [EXAMPLES.md](https://github.com/auth0/express-openid-connect/blob/master/EXAMPLES.md) document.\n\nSee the [examples](https://github.com/auth0/express-openid-connect/blob/master/EXAMPLES.md) for route-specific authentication, custom application session handling, requesting and using access tokens for external APIs, and more.\n\n### Use of Custom Session Stores and `genid`\n\nIf you create your own session id when using [Custom Session Stores](https://github.com/auth0/express-openid-connect/blob/master/EXAMPLES.md#9-use-a-custom-session-store) by overriding the `genid` configuration, you must use a suitable cryptographically strong random value of sufficient size to prevent collisions and reduce the ability to hijack a session by guessing the session ID.\n\n## API Reference\n\nExplore the express-openid-connect API.\n\n- [ConfigParams](https://auth0.github.io/express-openid-connect/interfaces/ConfigParams.html)\n\n**Provided middleware:**\n\n- [attemptSilentLogin](https://auth0.github.io/express-openid-connect/functions/attemptSilentLogin.html)\n- [auth](https://auth0.github.io/express-openid-connect/functions/auth.html)\n- [claimCheck](https://auth0.github.io/express-openid-connect/functions/claimCheck.html)\n- [claimEquals](https://auth0.github.io/express-openid-connect/functions/claimEquals.html)\n- [claimIncludes](https://auth0.github.io/express-openid-connect/functions/claimIncludes.html)\n- [requiresAuth](https://auth0.github.io/express-openid-connect/functions/requiresAuth.html)\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- [This repo's contribution guide](https://github.com/auth0/express-openid-connect/blob/master/CONTRIBUTING.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/express-openid-connect/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/whitehat) details the procedure for disclosing security issues.\n\n## What is Auth0?\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_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\"\u003e\n  Auth0 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\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  This project is licensed under the MIT license. See the \u003ca href=\"https://github.com/auth0/express-openid-connect/blob/master/LICENSE\"\u003e LICENSE\u003c/a\u003e file for more info.\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fexpress-openid-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fexpress-openid-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fexpress-openid-connect/lists"}