File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 28
28
from django .template import TemplateDoesNotExist
29
29
from django .utils .http import is_safe_url
30
30
from django .views .decorators .csrf import csrf_exempt
31
- from django .views .decorators .http import require_POST
32
- from saml2 import BINDING_HTTP_POST , BINDING_HTTP_REDIRECT
31
+ from saml2 import BINDING_HTTP_REDIRECT , BINDING_HTTP_POST
32
+ from saml2 .client_base import LogoutError
33
+ from saml2 .metadata import entity_descriptor
33
34
from saml2 .ident import code , decode
34
35
from saml2 .metadata import entity_descriptor
35
36
from saml2 .response import (SignatureError , StatusAuthnFailed , StatusError ,
@@ -376,7 +377,13 @@ def logout(request, config_loader_path=None):
376
377
'The session does not contain the subject id for user %s' ,
377
378
request .user )
378
379
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 ('/' )
380
387
381
388
state .sync ()
382
389
You can’t perform that action at this time.
0 commit comments