LibreChat/api/strategies
Juri Kuehn 13df8ed67c
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699)
* Allow setting the claim field to be used when OpenID login is configured

* fix(openid): harden getOpenIdEmail and expand test coverage

Guard against non-string claim values in getOpenIdEmail to prevent a
TypeError crash in isEmailDomainAllowed when domain restrictions are
configured. Improve warning messages to name the fallback chain
explicitly and distinguish missing vs. non-string claim values.

Fix the domain-block error log to record the resolved identifier rather
than userinfo.email, which was misleading when OPENID_EMAIL_CLAIM
resolved to a different field (e.g. upn).

Fix a latent test defect in openIdJwtStrategy.spec.js where the
~/server/services/Config mock exported getCustomConfig instead of
getAppConfig, the symbol actually consumed by openidStrategy.js.

Add refreshController tests covering the OPENID_EMAIL_CLAIM paths,
which were previously untested despite being a stated fix target.
Expand JWT strategy tests with null-payload, empty/whitespace
OPENID_EMAIL_CLAIM, migration-via-preferred_username, and call-order
assertions for the findUser lookup sequence.

* test(auth): enhance AuthController and openIdJwtStrategy tests for openidId updates

Added a new test in AuthController to verify that the openidId is updated correctly when a migration is triggered during the refresh process. Expanded the openIdJwtStrategy tests to include assertions for the updateUser function, ensuring that the correct parameters are passed when a user is found with a legacy email. This improves test coverage for OpenID-related functionality.

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2026-02-25 22:31:03 -05:00
..
appleStrategy.js 🧹 chore: Cleanup Logger and Utility Imports (#9935) 2025-10-01 23:30:47 -04:00
appleStrategy.test.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
discordStrategy.js 🍎 feat: Apple auth (#5473) 2025-01-31 09:49:09 -05:00
facebookStrategy.js 🍎 feat: Apple auth (#5473) 2025-01-31 09:49:09 -05:00
githubStrategy.js feat: added Github Enterprise SSO login (#5621) 2025-02-03 15:30:02 -05:00
googleStrategy.js 🧠 feat: Reasoning UI for Agents (#5904) 2025-02-15 18:52:29 -05:00
index.js 🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699) 2026-02-25 22:31:03 -05:00
jwtStrategy.js 🧑‍💻 refactor: Secure Field Selection for 2FA & API Build Sourcemap (#9087) 2025-08-15 18:55:49 -04:00
ldapStrategy.js 📧 fix: Case-Insensitive Domain Matching (#9868) 2025-09-27 21:20:19 -04:00
ldapStrategy.spec.js 📧 fix: Case-Insensitive Domain Matching (#9868) 2025-09-27 21:20:19 -04:00
localStrategy.js 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
openIdJwtStrategy.js 🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699) 2026-02-25 22:31:03 -05:00
openIdJwtStrategy.spec.js 🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699) 2026-02-25 22:31:03 -05:00
openidStrategy.js 🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699) 2026-02-25 22:31:03 -05:00
openidStrategy.spec.js 🪪 feat: Add OPENID_EMAIL_CLAIM for Configurable OpenID User Identifier (#11699) 2026-02-25 22:31:03 -05:00
process.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
process.test.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
samlStrategy.js 📧 fix: Case-Insensitive Domain Matching (#9868) 2025-09-27 21:20:19 -04:00
samlStrategy.spec.js 📧 fix: Case-Insensitive Domain Matching (#9868) 2025-09-27 21:20:19 -04:00
socialLogin.js 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
socialLogin.test.js 📬 refactor: Normalize Email Handling in User Methods (#10743) 2025-12-01 09:41:25 -05:00
validators.js 🔐 feat: Add Configurable Min. Password Length (#9315) 2025-08-27 16:30:56 -04:00
validators.spec.js 🔐 feat: Add Configurable Min. Password Length (#9315) 2025-08-27 16:30:56 -04:00