Skip to content
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

fix: spid-sp-test exit code in CI #55

Merged
merged 3 commits into from
Jun 14, 2021
Merged

fix: spid-sp-test exit code in CI #55

merged 3 commits into from
Jun 14, 2021

Conversation

peppelinux
Copy link
Member

This PR fails CI if at least one check of spid-sp-test will fail

This PR fails CI if at least one check of spid-sp-test will fail
@peppelinux peppelinux requested a review from brunato June 9, 2021 09:10
@brunato
Copy link
Collaborator

brunato commented Jun 9, 2021

Maybe can be fixed extracting the ID from self.request (if it's not None) and providing in_response_to=<requestID> to Saml2ResponseValidator (otherwise provide in_response_to=''):

class AssertionConsumerServiceView(djangosaml2_views.AssertionConsumerServiceView):
def custom_validation(self, response):
conf = get_config(None, self.request)
# Spid and SAML2 additional tests
accepted_time_diff = conf.accepted_time_diff
recipient = conf._sp_endpoints['assertion_consumer_service'][0][0]
authn_context_classref = settings.SPID_AUTH_CONTEXT
validator = Saml2ResponseValidator(authn_response=response.xmlstr,
recipient=recipient,
accepted_time_diff=accepted_time_diff,
authn_context_class_ref=authn_context_classref,
return_addrs=response.return_addrs)
validator.run()

@peppelinux
Copy link
Member Author

I think that the related saml2 request should be fetched from the outstanding cache, linked to djangosaml2 saml_session.
that's the place where we have all the related request in the user session

@peppelinux
Copy link
Member Author

This test still fails, the requests that makes the response is cookie-naive :)
That's why I'd look in this direction:
IdentityPython/djangosaml2#275

but it's only an option, let's see :)

@brunato brunato merged commit 03e4127 into dev Jun 14, 2021
@peppelinux peppelinux deleted the CI branch July 3, 2021 22:49
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