-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for Customizable OpenID Profile Fields via Environment Variable #5449
Conversation
@danny-avila i read your comment on a different pull request regarding a generic method for determining custom data from different openID providers. Is this going in the right direction? I would love to get some feedback to contribute to this amazing project. |
Simplifies token decoding by removing redundant utility functions, integrating direct decoding with proper error handling. Enhances logging clarity and consistency, improves role assignment logic, and adds robust error handling during avatar updates. Streamlines user creation and update processes while maintaining feature parity.
Removed @octokit/rest, @okta/okta-auth-js, and google-auth-library. Integrated @keycloak/keycloak-admin-client and @aws-sdk/client-cognito-identity-provider to enhance authentication handling. This change aligns dependencies with the updated authentication strategy.
Introduced a reusable MicrosoftGraphClient in the constructor and added a `setAccessToken` method for managing tokens. Simplified custom data mapping logic and improved validation and error handling for `customQuery` and token usage. Refactored `cleanOdataKeys` to `cleanData` for better clarity and efficiency.
The @keycloak/keycloak-admin-client package was removed as it is no longer required.
I'm hesitant to make drastic changes here since a lot of people depend on OpenID for Authentication. If you could introduce this with the least amount of changes, adhering to the original code as much as possible, that would be appreciated. The smallest of changes have caused headaches in this module before and I wish to avoid that. Also I noticed you wrote "// Not Tested" You shouldn't introduce code you aren't testing, rather focus on what does work and introduce it non-intrusively. Lastly, any new methods and functions, I would recommend introducing in another module other than |
thank you for the feedback. I will for sure simplify it and make as less changes as possible. then I will only add the option first of microsoft graph api. |
closed because of new pull request: #5612 |
Summary
Closes #4362
#4354
Docs: LibreChat-AI/librechat.ai#205
This Pull Request introduces comprehensive OpenID Connect (OIDC) support. The key changes include:
.env.example
to include new environment variables required for OpenID integration.userSchema.js
to accommodate additional fields for OpenID data, ensuring seamless user management.openidDataMapper.js
with provider-specific data mappers for Microsoft, AWS Cognito and Keycloak to handle custom OpenID data effectively.openidStrategy.js
to utilize the new data mappers, enforce role-based access control, and manage user avatars based on OpenID data.package.json
andpackage-lock.json
to include necessary libraries for OpenID functionality.types.ts
to support custom OpenID data mappings.Change Type
Testing
currently only the Microsoft provider tested and full working.
Checklist