-
Notifications
You must be signed in to change notification settings - Fork 11
CW-2776_Issue_with_casserver_and_service_urls_with_module.php_in_path #65
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
Closed
ioigoume
wants to merge
1
commit into
simplesamlphp:release-7.0
from
ioigoume:CW-2776_Issue_with_casserver_and_service_urls_with_module.php_in_path
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
This should be giving the exact same result?
If this is not the case, I think it might be better to rely on Symfony's request object and use
$request->getBaseUrl()instead of our own http-utilsThere 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.
@tvdijen I’m looking into the issue. These are the values I get when I use each method:
All methods except
Module::getModuleURL()return an incorrect value. It looks like themodule.phpsegment in the path is being treated as the end of the URL, right before the query string should start.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.
Why do you feel that anything after module.php should be ignored? It's not part of the query, so it's still included in the self URL.. The query starts after the
?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.
@tvdijen i found the underlying issue. I will provide more details tomorrow and then we can decide on the best next steps.
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.
Linking to SSP Pull Request 2589
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.
@tvdijen according to my findings the
HTTP::getSelfURL()mis-reconstructs the current URL when SimpleSAMLphp is accessed through a rewritten path such asRewriteRule ^/cas/login(.*) /${SSP_APACHE_ALIAS}module.php/casserver/login.php$1 [PT]. In this scenario the public URL is/cas/login?service=..., while Apache internally rewrites it to/simplesaml/module.php/casserver/login.php?service=.... The old implementation assumes that the script-relative filesystem path (for examplemodule.php/casserver/login.php) appears verbatim in$_SERVER['REQUEST_URI'], searches for that substring in the entireREQUEST_URI, and rebuilds the URL by stitching togethergetBaseURL(), that matched path, and the remainder ofREQUEST_URI. With mod_rewrite,REQUEST_URIcontains only the external path (/cas/login?...), so the expected script path is not present, or may only appear by accident inside query parameters. This causesgetSelfURL()to either fall back to an incorrect URL or to construct one that points tomodule.php/...instead of/cas/login, or that has a malformed path/query combination, breaking redirects and return URLs that rely ongetSelfURL()to reflect the actual public URL.