LibreChat/api
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
..
app/clients 🗄️ fix: Skip Attachments Deleted by Storage Retention Instead of Failing the Turn (#17910) 2026-11-08 23:38:47 +01:00
cache 🪪 feat: Name the Build and Config in Telemetry, Configure Stack Depth, Keep Scoped Frames (#17515) 2026-10-31 11:44:23 -04:00
config 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
db 🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441) 2026-10-26 01:08:30 +01:00
models 🥢 fix: Fit MCP App Snapshots Within Message Documents (#16299) 2026-10-01 03:46:17 +00:00
server 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
strategies 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
test 🧹 chore: Clear the Whole-Repo Lint Errors on Dev (#17702) 2026-11-01 01:23:47 +01:00
utils 💠 feat: Add Gemini 4 Argon Support (#17200) 2026-10-17 21:44:44 +02:00
jest.config.js 🦿 chore: Bump Agents SDK to 4.2.1 (#17664) 2026-10-31 15:17:05 -04:00
jsconfig.json
package.json 🪰 chore: Bump HTTP Dependencies and Scope Security Overrides (#17688) 2026-11-05 05:35:17 -05:00
recover-skill-upload.js 🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043) 2026-10-16 09:05:05 -07:00
typedefs.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00