Skip to content

Commit c72ecd1

Browse files
authored
Catch SAML logout errors and display error view (#225)
1 parent bd52a0a commit c72ecd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

djangosaml2/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,11 @@ def do_logout_service(request, data, binding, config_loader_path=None, next_page
518518

519519
if 'SAMLResponse' in data: # we started the logout
520520
logger.debug('Receiving a logout response from the IdP')
521-
response = client.parse_logout_request_response(data['SAMLResponse'], binding)
521+
try:
522+
response = client.parse_logout_request_response(data['SAMLResponse'], binding)
523+
except StatusError as e:
524+
response = None
525+
logger.warn("Error logging out from remote provider: " + str(e))
522526
state.sync()
523527
return finish_logout(request, response, next_page=next_page)
524528

0 commit comments

Comments
 (0)