Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ckanext/saml2auth/spconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from ckan.common import config as ckan_config
from ckan.common import asbool, aslist
from ckan.lib.helpers import _local_url


def get_config():
Expand Down Expand Up @@ -70,7 +71,7 @@ def get_config():
u'sp': {
u'name': u'CKAN SP',
u'endpoints': {
u'assertion_consumer_service': [base + acs_endpoint]
u'assertion_consumer_service': [_local_url(base + acs_endpoint, qualified=True)]
},
u'allow_unsolicited': True,
u'name_id_format': name_id_format,
Expand Down
7 changes: 7 additions & 0 deletions ckanext/saml2auth/tests/test_spconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ def test_read_acs_endpoint():
acs_endpoint = get_config()[u'service'][u'sp'][u'endpoints'][u'assertion_consumer_service'][0]
assert acs_endpoint.endswith('/my/acs/endpoint')

@pytest.mark.ckan_config(u'ckanext.saml2auth.acs_endpoint', u'/my/acs/endpoint')
@pytest.mark.ckan_config(u'ckan.root_path', u'/customrootpath')
def test_read_acs_endpoint_with_root_path():

acs_endpoint = get_config()[u'service'][u'sp'][u'endpoints'][u'assertion_consumer_service'][0]
assert acs_endpoint.endswith('/customrootpath/my/acs/endpoint')


@pytest.mark.ckan_config(u'ckanext.saml2auth.requested_authn_context', u'req1')
def test_one_requested_authn_context():
Expand Down