Skip to content

Include ckan root_path when building consumer service endpoint#118

Open
seitenbau-govdata wants to merge 1 commit intokeitaroinc:mainfrom
Seitenbau-Open-Data:feature/include_root_path_in_spconfig
Open

Include ckan root_path when building consumer service endpoint#118
seitenbau-govdata wants to merge 1 commit intokeitaroinc:mainfrom
Seitenbau-Open-Data:feature/include_root_path_in_spconfig

Conversation

@seitenbau-govdata
Copy link

@seitenbau-govdata seitenbau-govdata commented Apr 1, 2025

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_endpoint and 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_url method to create the correct url that will include root_path and the selected language, if the user has a non-default language selected.

@seitenbau-govdata seitenbau-govdata force-pushed the feature/include_root_path_in_spconfig branch from 1ace73a to 8fb0dcb Compare July 14, 2025 11:51
@seitenbau-govdata seitenbau-govdata force-pushed the feature/include_root_path_in_spconfig branch from 269fc3c to be3b69d Compare July 14, 2025 11:53
@seitenbau-govdata
Copy link
Author

We rebased the PR and changed the method to prepend the root_path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments