diff --git a/backend/src/openIDConnect/index.ts b/backend/src/openIDConnect/index.ts index 7bfdde040..11653afbb 100644 --- a/backend/src/openIDConnect/index.ts +++ b/backend/src/openIDConnect/index.ts @@ -27,8 +27,10 @@ export const jwks = async (req: any, res: any): Promise => { throw new Error(defaultErrorForCaller) } try { - const publicKey = await importSPKI(homeCommunity.publicJwtKey, 'RS256') - const jwk = await exportJWK(publicKey) + const rs256Key = await importSPKI(homeCommunity.publicJwtKey, 'RS256') + const rsaKey = await importSPKI(homeCommunity.publicJwtKey, 'RSA-OAEP-256') + const jwkRs256 = await exportJWK(rs256Key) + const jwkRsa = await exportJWK(rsaKey) // Optional: calculate Key ID (z.B. SHA-256 Fingerprint) const kid = createHash('sha256') @@ -38,11 +40,17 @@ export const jwks = async (req: any, res: any): Promise => { const jwks = { keys: [ { - ...jwk, + ...jwkRs256, alg: 'RS256', use: 'sig', kid, }, + { + ...jwkRsa, + alg: 'RSA-OAEP-256', + use: 'sig', + kid, + }, ], } res.setHeader('Cache-Control', 'public, max-age=3600, immutable')