Skip to main content

Django SAML2 Plugin for URL redirection on Logout (usually to an IdP logout)

Project description

django-saml2-auth-signout-redirect

A plugin to redirect users to a URL (usually an ADFS logout URL) in django-saml2-auth

Introduction

By default, django-saml2-auth only signs out users in the local Django application. For security reasons, the logout needs to be passed to the IdP (identity provider). Otherwise, a user who clicks the login button will be logged in again without providing a password (or otherwise). If you are able to sign the request (i.e. provide a cert and key), please see django-saml2-auth-signout-slo. If you are not able -- or do not want -- to sign the logout request, this plugin is your next-best option. Instead of a true Single SignOut, this plugin will let you redirect the user to the IdP's logout page, defaulting to the ADFS idpinitiatedsignin page.

Example

In settings.py:

INSTALLED_APPS += (
    ...
    'django_saml2_auth',
    # ensure the plugin is loaded
    'django_saml2_auth_signout_redirect',
    ...
)

# this is the "usual" config object from django-saml2-auth
SAML2_AUTH = {
    'DEFAULT_NEXT_URL': '/',
    'PLUGINS': {
        # use this package in lieu of DEFAULT signout plugin 
        'SINGOUT': ['REDIRECT'],
    },
    # optionally specify the URL
    'LOGOUT_REDIRECT_URL': 'https://<idp.com>/<logout>
}

ADFS

By default, this package redirects a user to <SSO Endpoint>/idpinitiatedsignon.aspx which provides manual login/logout on ADFS servers. Unless you're using an unconventional SSO path, this should work out-of-the-box.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

File details

Details for the file django_saml2_auth_signout_redirect-0.0.8.tar.gz.

File metadata

  • Download URL: django_saml2_auth_signout_redirect-0.0.8.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for django_saml2_auth_signout_redirect-0.0.8.tar.gz
Algorithm Hash digest
SHA256 8721d7ceb0c472d21fa73da85096dab9b24d59174c2abcd793bfef0bc708508e
MD5 691cac6437ff3e91370277951bde0458
BLAKE2b-256 497aa0392e8ac8646431c7bd37ef1367c5037adc71a2ecb519274911bb2b2707

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page