This repository was archived by the owner on May 19, 2025. It is now read-only.
Implement option for custom redirect URL & Fixes sessions for users not in local database - #11
Open
fservida wants to merge 3 commits into
Open
Implement option for custom redirect URL & Fixes sessions for users not in local database#11fservida wants to merge 3 commits into
fservida wants to merge 3 commits into
Conversation
Implement configuration parameter for OIDC redirect URL. Useful for setups behind reverse proxies where the URL is incorrectly detected leading to non working redirects
Users not in the user database could not use cookies due to the nature of the cookie itself and the check implemented by yourls. As such an additional cookie is created stored the username and an additional check is introduced in the plugin to validate the cookie against such username. The username cookie has the same security properties as the one set by yourls and is deleted upon logout.
Author
|
Thank you very much, this solved my issue similar to #7 |
|
@joshp23 Is there any way we can get this merged soon? |
|
This code has been stable and working for us for the past week or so with no issues |
mvalois
added a commit
to teicee/YOURLS-OIDC
that referenced
this pull request
Jun 25, 2024
Implement option for custom redirect URL & Fixes sessions for users not in local database joshp23#11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When using Yourls behind a reverse proxy apparently jumbojett has trouble detecting the correct URL, as it redirects to /admin and not /admin/ (at least in my setup using yours docker image).
This leads to subsequent broken redirects and http downgrade (probably more of an issue with yourls itself). (see screenshots). Because of the http downgrade, apart from the obvious problem of insecure traffic, this breaks implementations in frames.
I've managed to simply fix this by manually setting the redirect URL that the OIDC plugin uses instead of autodetecting it.
As it might be useful for others I've generalized the solution by reading an optional constant from the config.php file.