✨ feat: Add custom fields & role assignment to OpenID strategy #5798
+383
−141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes: #4670
Closes: #4362
Closes: #4354
Docs PR: LibreChat-AI/librechat.ai#205
This PR introduces key improvements to OpenID authentication, and dependency updates. The main enhancements include:
1. OpenID Authentication Enhancements
customOpenIdData
in the user schema to store provider-specific OpenID Connect attributes.userSchema.js
andtypes.ts
accordingly.openidDataMapper.js
module to extract custom OpenID attributes dynamically.openidStrategy.js
):safeDecode()
.extractRolesFromToken()
.2. LDAP Integration
ldapId
field in the user schema..env.example
to include LDAP-specific environment variables.3. Dependency Updates
openid-client
from5.4.2
to5.7.1
, which is the latest supported version for CommonJS (asv6
is ESM-only).passport
from0.6.0
to0.7.0
for improved authentication handling.@microsoft/microsoft-graph-client
to support Microsoft OpenID data mapping.4. Miscellaneous Improvements
HttpsProxyAgent
.Change Type
Testing
Checklist