Skip to content

Commit

Permalink
fix: spid logout won't redirect unlogged user to spid login (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe De Marco authored Jul 20, 2021
1 parent 44461c3 commit ab6b30b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="djangosaml2-spid",
version='1.1.1',
version='1.1.2',
description="Djangosaml2 SPID Service Provider",
long_description=README,
long_description_content_type='text/markdown',
Expand Down
4 changes: 3 additions & 1 deletion src/djangosaml2_spid/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ def spid_login(
return HttpResponseRedirect(headers["Location"])


@login_required
def spid_logout(request, config_loader_path=None, **kwargs):
"""SAML Logout Request initiator
This view initiates the SAML2 Logout request
using the pysaml2 library to create the LogoutRequest.
"""
if not request.user.is_authenticated:
return HttpResponseRedirect(settings.LOGOUT_REDIRECT_URL)

state = StateCache(request.saml_session)
conf = get_config(config_loader_path, request)
client = Saml2Client(
Expand Down

0 comments on commit ab6b30b

Please sign in to comment.