Checklist
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, express and typescript
- Set
tsconfig.json to 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-openid-connect@2.18.1
Express version
express@5.1.0
Node.js version
v22.17.1
Checklist
Description
When using this package with TypeScript configured to
NodeNextmodule resolution, which is the recommended value, we face an issue with three types, the most annoying for me beingIdTokenClaims.This problem is on
openid-client's side, and they already fixed it in version 5.1.6 (cf this commit line 33 of thepackage.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-clientversion, though there mightReproduction
express-openid-connect,expressandtypescripttsconfig.jsonto have the following configuration:{ "compilerOptions": { "moduleResolution": "nodeNext", "module": "NodeNext", } }Additional context
I'd like to avoid changing the
moduletoESNextandmoduleResolutiontonodeas much as possible, as I don't really know the impact.This also raises another question:
openid-clientshould 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-openid-connect@2.18.1
Express version
express@5.1.0
Node.js version
v22.17.1