Skip to content

Slo absence workaround #154

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

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
from django.template import TemplateDoesNotExist
from django.utils.http import is_safe_url
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT
from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST
from saml2.client_base import LogoutError
from saml2.metadata import entity_descriptor
from saml2.ident import code, decode
from saml2.metadata import entity_descriptor
from saml2.response import (SignatureError, StatusAuthnFailed, StatusError,
Expand Down Expand Up @@ -376,7 +377,13 @@ def logout(request, config_loader_path=None):
'The session does not contain the subject id for user %s',
request.user)

result = client.global_logout(subject_id)
try:
result = client.global_logout(subject_id)
except LogoutError as exp:
logger.exception('Error Handled - SLO not supported by IDP: {}'.format(exp))
auth.logout(request)
state.sync()
return HttpResponseRedirect('/')

state.sync()

Expand Down