Include ckan root_path when building consumer service endpoint#118
Open
seitenbau-govdata wants to merge 1 commit intokeitaroinc:mainfrom
Open
Include ckan root_path when building consumer service endpoint#118seitenbau-govdata wants to merge 1 commit intokeitaroinc:mainfrom
seitenbau-govdata wants to merge 1 commit intokeitaroinc:mainfrom
Conversation
1ace73a to
8fb0dcb
Compare
269fc3c to
be3b69d
Compare
Author
|
We rebased the PR and changed the method to prepend the root_path. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem:
When using the root_path option in ckan.ini, the url given to the IDP did not include that part. This way the IDP could not redirect to the ACS after login, if ckan was running on another path than "/".
In our setup we have a nginx-reverse-proxy that filters the root_path (requests "/root_path/something" get redirected to ckan server as "/something") and the root_path is defined as "/root_path" in ckan.ini (in this example).
We first tried to modify
ckanext.saml2auth.acs_endpointand set it to "/root_path/acs", but that messed up the add_url_rule routes for the acs view.The solution:
We used CKANs
_local_urlmethod to create the correct url that will includeroot_pathand the selected language, if the user has a non-default language selected.