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

Single logout should raise on request failure #82

Open
beheh opened this issue Jul 8, 2019 · 1 comment
Open

Single logout should raise on request failure #82

beheh opened this issue Jul 8, 2019 · 1 comment

Comments

@beheh
Copy link

beheh commented Jul 8, 2019

Right now, a network failure during remote logout (as part of SLO) will be silently ignored by mama_cas. It seems crucial that a logout failure is raised or at least returned so that the user can take appropriate action, like retry or refuse to logout.

Specifically, ServiceTicket.request_sign_out will blindly session.post without looking at the response.

def request_sign_out(self, session=requests):
"""
Send a POST request to the ``ServiceTicket``s logout URL to
request sign-out.
"""
if logout_allowed(self.service):
request = SingleSignOutRequest(context={'ticket': self})
url = get_logout_url(self.service) or self.service
session.post(url, data={'logoutRequest': request.render_content()})
logger.info("Single sign-out request sent to %s" % url)

This should probably raise on at least some very severe network errors, like timeouts or internal server errors.

I'm not sure how this plays with the requests-futures support, but it seems like mama_cas should at least expose a way to do this if you really want to.

@beheh beheh changed the title Remote signout should raise on request failure Single logout should raise on request failure Jul 8, 2019
@zxbzxb180
Copy link

Excuse me, why does my request_sign_out not execute?

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

No branches or pull requests

2 participants