-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Enable OpenID Auto-Redirect #6066
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please have a look at my comment :)
@leondape thank you for updating the code. What do you think about instead of using the default url for redirecting have a parameter in the url to trigger this? So we don't need to make too many changes in the code? This will also solve the infinite redirect loop? |
@rubentalstra could you elaborate your idea? I don’t quite get what you mean. :) |
@leondape instead of having a default direct to the OIDC? have the parameter so this? so when you use |
I understand. |
@rubentalstra I just saw you merged into main? |
@leondape I did not merged it into |
aaaah I was just to stupid to read! Thank you. Looking forward to your solution. |
…auto-redirect logic
Vey cool, I see it works? :) Also.. different question: how can you setup the startup overlay message which can be seen in the video? |
@leondape if I merge from my branch then I need to close your PR. but I don;t want to take away your time and effort to start it :). so to keep this PR it would be great if you could just update your branch with the changes from this branch: but if you don't mind then I will close this PR and create a new PR. regarding the redirect message. this was just something I wanted to show the user with a little slower internet connection. will add a override text to it later as well was just an example. |
How forsightful, thank you! |
@leondape have a look at this config/update-banner.js and config/delete-banner.js package.json "update-banner": "node config/update-banner.js",
"delete-banner": "node config/delete-banner.js", here you can set a banner. but I could not find it documented somewhere. |
interesting. Looking forward to the banner release! |
You can already use the banner as described here. I already used it and it works! |
@leondape I have updated it a little more: https://github.com/danny-avila/LibreChat/compare/feat/oidc-auto-redirect could you have a look please |
I updated it but must say for protocol that I did not have the time to review any of your changes. |
From here. But it's only a Term and Conditions acceptance dialog, not for general info I guess. |
@danny-avila |
Summary
Closes: #5683
Docs: LibreChat-AI/librechat.ai#250
This pull request introduces several changes to support automatic redirection to an OpenID provider and improve the handling of user authentication. The most important changes include adding a new environment variable for OpenID auto-redirect, updating the login flow to handle this redirection, and enhancing the logout functionality to support custom redirects.
OpenID Auto-Redirect:
.env.example
: AddedOPENID_AUTO_REDIRECT
environment variable to enable automatic redirection to the OpenID provider when a user visits the login page.api/server/routes/config.js
: Updated the configuration to include theopenidAutoRedirect
property.client/src/components/Auth/Login.tsx
: Implemented logic to handle auto-redirect to the OpenID provider based on the startup configuration and URL parameters.Logout Functionality:
client/src/common/types.ts
: Modified thelogout
function to accept an optionalredirect
parameter.client/src/hooks/AuthContext.tsx
: Enhanced thelogout
function to support custom redirects and ensure the redirect parameter is cleared after use. [1] [2]Error Handling and Localization:
client/src/locales/en/translation.json
: Added a new localization string for the redirection message.client/src/utils/getLoginError.ts
: Updated thegetLoginError
function to use a specific type for translation keys.These changes improve the user experience by streamlining the login process and providing more flexibility in handling authentication flows.
Change Type
Basically the Login page and config types were changed. Please review if any security questions have been touched. If think t should be fine.
Documented in: LibreChat-AI/librechat.ai#250
Checklist