Skip to main content
https://badge.fury.io/py/django-url-sso.png https://secure.travis-ci.org/visualspace/django-url-sso.png?branch=master https://pypip.in/d/django-url-sso/badge.png

Generate login URL’s for unstandardized SSO systems.

What is it?

We all know it is better for single sign-on systems to make use of properly standardized, tested and known secure protocols. That it is bad practise to put login tokens in HTTP query parameters.

However, sometimes things just aren’t as you wish they would be. Bad API’s are out there and are numerous. And sometimes, we cannot avoid having to talk to them. That’s what this module is for:

It allows configurable plugins to generate login URL’s and use a RequestContextProcessor to make them available in templates.

Status

Well tested and stable, though documentation is still a work in progress.

Compatibility

Tested to work with Django 1.4, 1.5 and 1.6 and Python 2.6 as well as 2.7.

Requirements

Please refer to requirements.txt for an updated list of required packages.

Settings

There are two types of settigns in this package: common settings across plugins and plugin specifc settings. Currently the only common setting is URL_SSO_PLUGINS which lists the enabled plugins. Example:

URL_SSO_PLUGINS = [
    'url_sso.plugins.intershift.intershift_plugin',
    'url_sso.plugins.iprova.iprova_plugin'
]

Also, be sure to enable the RequestContextProcessor if you want the URL’s to be available in your template context (and you do):

TEMPLATE_CONTEXT_PROCESSORS = [
    ...
    'url_sso.context_processors.login_urls'
    ...
]

Plugins

Currently, SSO for two systems are implemented:

Intershift

Plugin name: url_sso.plugins.intershift.intershift_plugin

For each configured site in sites (see below), this plugin makes a URL available by the following name:

`INTERSHIFT_<SITENAME>_SSO_URL`
Settings

Example settings:

URL_SSO_INTERSHIFT = {
    # Secret key as specified by Intershift
    'secret': '12345678',
    # Sites enabled for SSO
    'sites': {
        'site1': {
            # Users never have access to site1
            'has_access': lambda request: False,
            'url': 'https://customer1.intershift.nl/site1/cust/singlesignon.asp',
            'has_access': lambda request: request.user.groups.filter(name='some_group').exists()
        },
        'site2': {
            # Users always have acces to site2
            'has_access': lambda request: True,
            'url': 'https://customer1.intershift.nl/site2/cust/singlesignon.asp',
        },
        'site3': {
            # No explicit access rules; same result as site2
            'url': 'https://customer1.intershift.nl/site3/cust/singlesignon.asp',
        },
    },
    # Key expiration in seconds, use one day here
    'key_expiration': 86400
}

Infoland iProva

Plugin name: url_sso.plugins.iprova.iprova_plugin

This plugin makes the following login URL’s available, depending on which services are configured in the services setting below:

  • IPROVA_MANAGEMENT_SSO_URL

  • IPROVA_IDOCUMENT_SSO_URL

  • IPROVA_IPORTAL_SSO_URL

  • IPROVA_ITASK_SSO_URL

Settings

Example settings:

URL_SSO_IPROVA = iprova_settings = {
    # Service root URL
    'root_url': 'http://intranet.organisation.com/',

    # Services available for SSO
    'services': ('management', 'idocument', 'iportal', 'itask'),

    # Key expiration in seconds, use one hour here
    'key_expiration': 3600,

    'application_id': 'SharepointIntranet_Production',

    'has_access': lambda request, service: request.user.groups.filter(name='some_group').exists()
}

Tests

Tests for pull req’s and the master branch are automatically run through Travis CI.

License

This application is released under the GNU Affero General Public License version 3.

Release files for django-url-sso 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-url-sso 0.9
File Size Uploaded
django-url-sso-0.9.tar.gz 37.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-url-sso 0.9
File Interpreter ABI Platform
django_url_sso-0.9-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 81.4 kB

Release files / django-url-sso-0.9.tar.gz

Download URL django-url-sso-0.9.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2632c38fc113c985170237895c017676d0f0bd9500459f880a8493f22d6aba42
BLAKE2b-256 checksum
How to use checksums
966856d0741eb47078d4a3c1f231e927045504908bb69c2e451269ef23785f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_url_sso-0.9-py2.py3-none-any.whl

Download URL django_url_sso-0.9-py2.py3-none-any.whl
Size 43.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1f2ee14a6e9711cc4caed8660d1665564e004ade54a8aa7e81584bb77f9da73d
BLAKE2b-256 checksum
How to use checksums
4a9ea236de96d9a7aee9ad810411658d9bb48aeba0fc7648521fa6748075d952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page