LibreChat/api/strategies
Marco Beretta 4bded120a9
🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904)
* fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts

The OpenID reuse path in refreshController and the post-refresh fallback in
getOpenIDAppAuthToken returned the cached access token as the app auth token
whenever its exp was in the future. Entra issues Microsoft Graph access tokens
to sign-in clients by default; their aud names Graph, so the bearer verifier
rejects them and every protected request answers 401 until the client loops.

Both paths now require the access token's aud to name the client id or an
OPENID_AUDIENCE entry, the same audiences the verifier accepts. The reuse path
refreshes with the IdP instead, and the post-refresh fallback keeps opaque
tokens as before. Audience parsing is shared with openIdJwtStrategy.

Related to #17791

* test: Exercise Real OpenID Audience Helpers in AuthService Spec

The AuthService spec stubbed the audience helpers as pass-throughs, so it
could not catch a foreign-audience access token escaping the post-refresh
fallback. Use the real exports and cover Graph-audience, configured-audience
and opaque access tokens through setOpenIDAuthTokens.
2026-11-08 23:40:21 +01:00
..
appleStrategy.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
appleStrategy.test.js
discordStrategy.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
facebookStrategy.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
githubStrategy.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
googleStrategy.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
index.js
jwtStrategy.js 🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466) 2026-10-30 00:24:08 +01:00
jwtStrategy.spec.js 🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466) 2026-10-30 00:24:08 +01:00
ldapStrategy.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
ldapStrategy.spec.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
localStrategy.js ⬆️ feat: Migrate to Zod v4 (#17442) 2026-10-26 14:16:22 +01:00
openIdJwtStrategy.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
openIdJwtStrategy.spec.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
openidStrategy.js 🔐 fix: Keep the Admin OpenID State So PKCE Holds When the IdP Omits S256 (#17478) 2026-10-28 18:33:12 +01:00
openidStrategy.spec.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
process.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
process.test.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
samlStrategy.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
samlStrategy.spec.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
socialLogin.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
socialLogin.test.js 🔐 fix: Apply Base Config Overrides Before Sign-In and Refuse Script Policy Links (#17351) 2026-10-22 22:49:54 +02:00
validators.js
validators.spec.js ⬆️ feat: Migrate to Zod v4 (#17442) 2026-10-26 14:16:22 +01:00