Skip to main content

Django SAML2 Plugin for URL redirection on IDP Error (usually to an IdP login)

Project description


A plugin to redirect users to a URL (usually the login page) in response to an authentication error in django-saml2-auth.


By default, django-saml2-auth redirects users to the :denied page in response to authentication errors. django-saml2-auth-idperror-redirect will instead redirect the user to another URL (or view), usually the login page.



    # ensure the plugin is loaded

# this is the "usual" config object from django-saml2-auth
    'DEFAULT_NEXT_URL': '/',
    'PLUGINS': {
        # use this package in lieu of DEFAULT IDP Error plugin 
        'IDP_ERROR': ['REDIRECT'],
    # must provide a URL or VIEW
    'IDP_ERROR_REDIRECT_URL': 'https://...',
    # whether or not to include a next=<url> query argument

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

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page