-
Notifications
You must be signed in to change notification settings - Fork 156
Description
Checklist
- The issue can be reproduced in the express-openid-connect sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
When using this package with TypeScript configured to NodeNext module resolution, which is the recommended value, we face an issue with three types, the most annoying for me being IdTokenClaims.
This problem is on openid-client's side, and they already fixed it in version 5.1.6 (cf this commit line 33 of the package.json).
So now the issue is on your side. The version used in this project is ^4.9.1 which is 2 whole major version behind the latest one (6.6.2 as of this issue's creation). It should be fixed by bumping the openid-client version, though there might
Reproduction
- Create a project with
express-openid-connect,expressandtypescript - Set
tsconfig.jsonto have the following configuration:{ "compilerOptions": { "moduleResolution": "nodeNext", "module": "NodeNext", } } - Create the following file
import express from "express"; import expressOpenidConnect from "express-openid-connect"; const { auth } = expressOpenidConnect; const app = express(); app.use( auth({ issuerBaseURL: process.env.OIDC_ISSUER_BASEURL, baseURL: process.env.OIDC_BASEURL, clientID: process.env.OIDC_CLIENT_ID, secret: process.env.OIDC_ENCRYPTION_SECRET, clientSecret: process.env.OIDC_CLIENT_SECRET, attemptSilentLogin: true, idpLogout: true, authorizationParams: { response_type: "code", scope: "openid profile email", }, routes: { callback: "/auth/redirect", login: "/auth/login", logout: "/auth/logout", }, }) ); app.use((req, _res, next) => { console.debug("idTokenClaims", req.oidc.idTokenClaims); if (!req.oidc.idTokenClaims.email) { throw new Error("Aucun utilisateur détecté, merci de contacter le support technique."); } next() });
- Here is the issue :

Additional context
I'd like to avoid changing the module to ESNext and moduleResolution to node as much as possible, as I don't really know the impact.
This also raises another question: openid-client should be one of, if not the most important dependency of this project. So why has it not been updated for nearly 4 years even though this project is still actively maintained. It seems voluntary (cf. #491), but I don't get why.
express-openid-connect version
Express version
Node.js version
v22.17.1