Fix issue with redirects loosing args #124
Merged
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.
Redirect URL is not encoded in the
redirect_toarg, and it may loose it's own args which will be applied to the parent URL... also the URL with missing args might become invalid, example:As a logged out user we are entering the page that requires user to be logged in:
https://mysite.example.com/?p=1234&preview=1&secret=1234User being redirected to:
https://mysite.example.com/wp-login.php?redirect_to=https%3A%2F%2Fmysite.example.com%2F%3Fp%3D1234%26preview%3D1%26secret%3D1234But then the information that is passed to SimpleSAML lib contains already improperly formatted URL, with not encoded
redirect_toarg:https://mysite.example.com/wp-login.php?redirect_to=https://mysite.example.com/?p=1234&preview=1&secret=1234&action=wp-saml-authAfter all, after successful login, user is redirected to:
https://mysite.example.com/?p=1234but should be to:
https://mysite.example.com/?p=1234&preview=1&secret=1234