File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636from django .views .decorators .csrf import csrf_exempt
3737
3838from saml2 import BINDING_HTTP_REDIRECT , BINDING_HTTP_POST
39+ from saml2 .client_base import LogoutError
3940from saml2 .metadata import entity_descriptor
4041from saml2 .ident import code , decode
4142from saml2 .sigver import MissingKey
@@ -376,7 +377,13 @@ def logout(request, config_loader_path=None):
376377 'The session does not contain the subject id for user %s' ,
377378 request .user )
378379
379- result = client .global_logout (subject_id )
380+ try :
381+ result = client .global_logout (subject_id )
382+ except LogoutError as exp :
383+ logger .exception ('Error Handled - SLO not supported by IDP: {}' .format (exp ))
384+ auth .logout (request )
385+ state .sync ()
386+ return HttpResponseRedirect ('/' )
380387
381388 state .sync ()
382389
You can’t perform that action at this time.
0 commit comments