LibreChat/api/server/controllers
Peter bf80cf30b3
*️⃣ feat: Reuse OpenID Auth Tokens (#7397)
* feat: integrate OpenID Connect support with token reuse

- Added `jwks-rsa` and `new-openid-client` dependencies for OpenID Connect functionality.
- Implemented OpenID token refresh logic in `AuthController`.
- Enhanced `LogoutController` to handle OpenID logout and session termination.
- Updated JWT authentication middleware to support OpenID token provider.
- Modified OAuth routes to accommodate OpenID authentication and token management.
- Created `setOpenIDAuthTokens` function to manage OpenID tokens in cookies.
- Upgraded OpenID strategy with user info fetching and token exchange protocol.
- Introduced `openIdJwtLogin` strategy for handling OpenID JWT tokens.
- Added caching mechanism for exchanged OpenID tokens.
- Updated configuration to include OpenID exchanged tokens cache key.
- updated .env.example to include the new env variables needed for the feature.

* fix: update return type in downloadImage documentation for clarity and fixed openIdJwtLogin env variables

* fix: update Jest configuration and tests for OpenID strategy integration

* fix: update OpenID strategy to include callback URL in setup

* fix: fix optionalJwtAuth middleware to support OpenID token reuse and improve currentUrl method in CustomOpenIDStrategy to override the dynamic host issue related to proxy (e.g. cloudfront)

* fix: fixed code formatting

* Fix: Add mocks for openid-client and passport strategy in Jest configuration to fix unit tests

* fix eslint errors: Format mock file openid-client.

*  feat: Add PKCE support for OpenID and default handling in strategy setup

---------

Co-authored-by: Atef Bellaaj <slalom.bellaaj@external.daimlertruck.com>
Co-authored-by: Ruben Talstra <RubenTalstra1211@outlook.com>
2025-05-23 17:40:40 -04:00
..
agents feat: Agent Version History and Management (#7455) 2025-05-23 17:40:39 -04:00
assistants 🔬 fix: File Search Request Format (Azure Assistants API) (#7404) 2025-05-20 08:43:12 -04:00
auth *️⃣ feat: Reuse OpenID Auth Tokens (#7397) 2025-05-23 17:40:40 -04:00
AskController.js 💬 refactor: MCP Chat Visibility Option, Google Rates, Remove OpenAPI Plugins (#7286) 2025-05-08 12:12:36 -04:00
AuthController.js *️⃣ feat: Reuse OpenID Auth Tokens (#7397) 2025-05-23 17:40:40 -04:00
Balance.js 🧮 feat: Improve structured token spending and testing; fix: Anthropic Cache Spend (#3766) 2024-08-24 04:36:08 -04:00
EditController.js 🗓️ feat: Add Special Variables for Prompts & Agents, Prompt UI Improvements (#7123) 2025-04-29 03:49:02 -04:00
EndpointController.js refactor: Integrate Capabilities into Agent File Uploads and Tool Handling (#5048) 2024-12-19 13:04:48 -05:00
ErrorController.js 🛡️ : Security Enhancements (#1681) 2024-01-30 14:34:02 -05:00
ModelController.js 🚀 feat: Enhance Model Handling, Logging & xAI Agent Support (#6182) 2025-03-05 12:04:26 -05:00
OverrideController.js 💫 feat: Config File & Custom Endpoints (#1474) 2024-01-03 09:22:48 -05:00
PluginController.js 💬 refactor: MCP Chat Visibility Option, Google Rates, Remove OpenAPI Plugins (#7286) 2025-05-08 12:12:36 -04:00
tools.js 🔍 feat: Mistral OCR API / Upload Files as Text (#6274) 2025-03-10 17:23:46 -04:00
TwoFactorController.js 🔐 fix: Invalid Key Length in 2FA Encryption (#6432) 2025-03-20 16:46:11 -04:00
UserController.js 🔄 fix: Avatar & Error Handling Enhancements (#6687) 2025-04-02 18:44:13 -04:00