Skip to main content
=====
WAYF
=====

WAYF is a simple Django app that implements a SAML WAYF (Where Are You From) service.
It allows you to select your home idP (institute) for further redirection,
by parsing your federation metadata(.xml)

This code originates from https://code.grnet.gr/projects/wayf

it was adapted to split of the wayf part as a separate usable django app


Quick start
-----------

1. Add "wayf" to your INSTALLED_APPS setting and configure the location of your metadata like this::

INSTALLED_APPS = [
...
'wayf',
]
SHIB_METADATA = 'federation-metadata.xml'
INSTITUTION_CATEGORIES = (
('university', ("Universities")),
('tei', ("Technological educational institutes")),
('school', ("Other academic institutions")),
('institute', ("Research institutes")),
('other', ("Please select your institute")),
('test', ("Testing")),
)
P3P_HEADER = ''
IDP_COOKIE = 'wayf_selected_idp'
LAST_IDP_COOKIE = 'wayf_last_idp'
COOKIE_DOMAIN = '.example.com'

2. Include the wayf URLconf in your project urls.py like this::

url(r'^wayf', include('wayf.urls')),

If you want more flexibility around the templates,
there is only one view for the basic app
wayf.views.wayf
so you can create your own url that points to just this view.
The templates shipped with wayf extend a base.html template, where they will insert their html in the {% content %} tag.


3. This app doesn't store anything in it's models, so no migrations are needed

4. Start the development server and visit http://127.0.0.1:8000/wayf
To select your home institute

5. Configure your shibboleth2.xml file to use this wayf::
<SessionInitiator type="Chaining" Location="/DS" id="DS" isDefault="true" relayState="cookie">
<SessionInitiator type="SAMLDS" URL="https://example.com/wayf"/>
<SessionInitiator/>


extra
---
The only view you really need is wayf.views.wayf

however, wayf.views contains a few other views, that can help you generate auto generated pages
for users, e.g. using templates like::

If you encountered a problem <b>in your Home Organization's authentication page</b>, then you should contact your Home Organization's User Helpdesk. This is also the place to s olve account-related issues, like the loss or change of your password, change of your contact details, etc.
{% if idp.contact.email or idp.contact.telephone %}
According to your selected Home Organization, &quot;<b>{{ idpname }}</b>&quot;, you may use the following contact details for getting support:
<ul id="contactdetails">
{% if idp.contact.email %}
<li><strong>E-mail:</strong> <a href="mailto:{{ idp.contact.email }}?subject=AAI+issue+report">{{ idp.contact.email }}</a></li>
{% endif %}
{% if idp.contact.telephone %}
<li><strong>{% trans "Telephone" %}:</strong> {{ idp.contact.telephone }}</li>
{% endif %}
</ul>
{% endif %}</li>


dependencies
---

This suite requires the following python modules to be present on the system:

- python-lxml: uses lxml.objectify to parse the XML metadata
optional, not fully implemented yet, you will need to manually make some changes:
- pydns: used for reverse DNS lookup to get a hint about a user's preferred IdP
- IPy: used for IP map manipulation

Download files

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

Source Distribution

django-wayf-0.2.0.tar.gz (29.1 kB view details)

Uploaded Source

File details

Details for the file django-wayf-0.2.0.tar.gz.

File metadata

  • Download URL: django-wayf-0.2.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-wayf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 672db7542e6b9fe335c05e4041b8b5f56c55a63e4cb5023e4114d715bc7f762e
MD5 c1a2ac36949542a29299ab9b50be8303
BLAKE2b-256 74d4e44bf082efe0c52a8d43daa8228e84f2dfabc77b43f449c6586265184c75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page