social-edu-federation


Namesocial-edu-federation JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/openfun/social-edu-federation
SummaryAn SAML backend for python-social-auth dedicated to education federation (RENATER)
upload_time2023-01-12 14:25:01
maintainer
docs_urlNone
authorOpen FUN (France Universite Numerique)
requires_python
licenseMIT
keywords python3-saml python-social-auth renater shibboleth federation education-recherche
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # social-edu-federation: An SAML authentication backend for python-social-auth dedicated to education federation (RENATER)

[![Python version](https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10-blue.svg)](https://www.python.org/)
[![Django version](https://img.shields.io/badge/Django-3.2%20|%204.0-green.svg)](https://www.djangoproject.com/)
[![CircleCI](https://circleci.com/gh/openfun/social-edu-federation/tree/main.svg?style=svg)](https://circleci.com/gh/openfun/social-edu-federation/tree/main)

## Overview

This library provides an authentication backend which can be used with
[Python Social Auth](https://github.com/python-social-auth/social-core)
and optionally
[Python Social Auth - Django](https://github.com/python-social-auth/social-app-django)
to connect your application to an education SAML federation.

Before beginning, you must read the above documentations.

For now, it is only limited to the
[RENATER](https://services.renater.fr/federation/en/documentation/generale/metadata/index)'s
"Féderation Éducation-Recherche" (FER) federation.


## Architecture

`social-edu-federation` is divided in two parts:
- The SAML backend and metadata parser, customized for the FER federation,
  usable with Python Social Auth.
- The Django integration which provides: base views to provide metadata, list available
  Identity Providers and testing material for local development.


### Authentication behavior

This library parses the metadata to extract base SAML authentication for each identity
provider in the federation metadata plus some extra information
(see below *Setup - Core* section)

The authentication process can be summarized in few steps:

- The federation metadata are parsed to fetch the identity providers list.
- User choose an identity provider in the list with which they have an account and want to login.
- The backend makes an SAML authentication request and redirects the user to the identity provider
  "single login" page.
- The user logs in on the identity provider website and is redirected to our (Service Provider) site.
- The SAML FER backend will extract authentication data it needs from the authentication response
  assertions.
  The used assertions are:
  - **urn:oid:2.5.4.4** (sn) aka (surname)
    This represents the user's first name.
  - **urn:oid:2.5.4.42** (givenName) aka (gn)
    This represents the user's last name.
  - **urn:oid:2.16.840.1.113730.3.1.241** (displayName)
    This represents the user's full name.
  - **urn:oid:0.9.2342.19200300.100.1.3** (mail)
    Provides us the user email, we use it as email address and username.
  - **urn:oid:1.3.6.1.4.1.5923.1.1.1.1** (eduPersonAffiliation)
    Provides us the user's role(s) list.
    This is not mandatory.

  Fields we do not use:
   - **urn:oid:1.3.6.1.4.1.7135.1.2.1.14** (supannEtablissement)

  All fields are documented on
  [Renater supann](https://services.renater.fr/documentation/supann/supann2021/recommandations/attributs/liste_des_attributs).
- The authentication response passes through the "Social auth" pipeline.
  `social-edu-federation` provides one extra step to replace the
  `social_core.pipeline.user.create_user` original one. This step allows to have a fallback
  on the user's *full name* if one of the *first name* or *last name* is not available.

## Setup

### Core

You may install only the library core which will provide you with:
- The FER metadata parser (see `social_edu_federation.parser.FederationMetadataParser`)
  which is an extension of the original `python3-saml`'s `OneLogin_Saml2_IdPMetadataParser`
  and provides extra features as:
  - Extract all the identity providers at once
  - Extract extra information from each identity provider metadata (
    the identity provider's display name,
    the identity provider's organization name,
    the identity provider's organization display name)
- A basic "metadata store" which is not really helpful but organizes the process of fetching
  the metadata and convert it to a Python Social Auth like object, usable by the authentication
  backend.
- The SAML authentication backend which is preconfigured to be used with the FER federation.

```shell
$ pip install social-edu-federation
```

### Django integration

If you also want to add this library into a Django project you may explicitly add the `django` extra while installing the library:

```shell
$ pip install social-edu-federation[django]
```

It is also recommended to add `social_edu_federation.django.apps.PythonSocialEduFedAuthConfig`
to your `INSTALLED_APPS` to get the following features:

- A Django check which asserts the default "metadata store" is overridden.
- The `prefetch_saml_fer_metadata` management command (see *Cache management* below).
- The static files and Django views default templates (see *Using the default views* below).

#### Cache management

When using the Django integration, it is highly recommended to define a Django setting to
tell `social_edu_federation` to use the "metadata store with cache". This will avoid fetching
the whole federation metadata everytime we need an information about one identity
provider.

```python
# settings.py
SOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_STORE = "social_edu_federation.django.metadata_store.CachedMetadataStore"
```

This "metadata store" will use the Django `default` cache which can be easily replaced by
the cache backend of your choice:

```python
# settings.py
SOCIAL_AUTH_SAML_FER_DJANGO_CACHE = "redis"

assert SOCIAL_AUTH_SAML_FER_DJANGO_CACHE in CACHES, "cache backend name is not in settings.CACHES"
```

If you installed the `social_edu_federation` Django application, you will be able to
fill the cache asynchronously using the `prefetch_saml_fer_metadata` management
command, by defining a cron job which will call
`django-admin prefetch_saml_fer_metadata saml_fer` to refresh the FER cache.
Using this make sure that no actual user has to wait for the full federation metadata to load
loading time.

#### Project setup

For a basic use of the FER backend for authentication you will need to define:

```python
# settings.py
INSTALLED_APPS = [
    # ...
    "social_django.apps.PythonSocialAuthConfig",  # see python-social-auth
    "social_edu_federation.django.apps.PythonSocialEduFedAuthConfig",
]
MIDDLEWARE = [
    # ...
    "social_django.middleware.SocialAuthExceptionMiddleware",  # At the end
]

AUTHENTICATION_BACKENDS = [
    "social_edu_federation.backends.saml_fer.FERSAMLAuth",
    "django.contrib.auth.backends.ModelBackend",  # only if you keep Django basic auth
]

# Python social auth
SOCIAL_AUTH_JSONFIELD_ENABLED = True

SOCIAL_AUTH_SAML_FER_SECURITY_CONFIG = {
    "authnRequestsSigned": True,
    "signMetadata": True,
    "wantAssertionsSigned": True,
    "rejectDeprecatedAlgorithm": True,
}

# Specific social_edu_federation
SOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_STORE = "social_edu_federation.django.metadata_store.CachedMetadataStore"

# SOCIAL_AUTH_SAML_FER_SP_ENTITY_ID should be a URL that includes a domain name you own
SOCIAL_AUTH_SAML_FER_SP_ENTITY_ID = "https://you-site.example/saml/metadata/"
# SOCIAL_AUTH_SAML_FER_SP_PUBLIC_CERT X.509 certificate for the key pair that
# your app will use
SOCIAL_AUTH_SAML_FER_SP_PUBLIC_CERT = "MII..."
# SOCIAL_AUTH_SAML_FER_SP_PRIVATE_KEY The private key to be used by your app
SOCIAL_AUTH_SAML_FER_SP_PRIVATE_KEY = "MII..."

# Next certificate management, keep empty when next certificate is still not known
SOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT = None
SOCIAL_AUTH_SAML_FER_SP_EXTRA = (
    {
        "x509certNew": SOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT,
    }
    if SOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT
    else {}
)

SOCIAL_AUTH_SAML_FER_ORG_INFO = {  # specify values for English at a minimum
    "en-US": {
        "name": "Organization name",
        "displayname": "Organization display name",
        "url": "https://you-site.example",
    }
}
# SOCIAL_AUTH_SAML_FER_TECHNICAL_CONTACT technical contact responsible for your app
SOCIAL_AUTH_SAML_FER_TECHNICAL_CONTACT = {
    "givenName": "Dev team",
    "emailAddress": "dev@example.com",
}
# SOCIAL_AUTH_SAML_FER_SUPPORT_CONTACT support contact for your app
SOCIAL_AUTH_SAML_FER_SUPPORT_CONTACT = {
    "givenName": "Dev team",
    "emailAddress": "dev@example.com",
}
# SOCIAL_AUTH_SAML_FER_ENABLED_IDPS is not required since the
# SAML FER backend is overridden to allow dynamic IdPs.
# see social_edu_federation.backends.saml_fer.FERSAMLAuth.get_idp(idp_name)

# Custom parameter to define the FER Federation Metadata
SOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_URL = (
    "https://metadata.federation.renater.fr/renater/main/main-idps-renater-metadata.xml"
)

# Use (or not) the default pipeline with the first/last name cleanup step
from social_edu_federation.pipeline import DEFAULT_EDU_FED_AUTH_PIPELINE
SOCIAL_AUTH_SAML_FER_PIPELINE = DEFAULT_EDU_FED_AUTH_PIPELINE
```

#### Using the default views

To make your Service Provider metadata publicly available, you will need to add
the following URL:

```python
# some_module/urls.py
from django.urls import path

from social_edu_federation.django.views import EduFedMetadataView


urlpatterns = [
    # ...
    path(
        "saml/metadata/",
        EduFedMetadataView.as_view(backend_name="saml_fer"),
        name="saml_fer_metadata",
    ),
]
```

You may also want to have a look at the provided `EduFedIdpChoiceView` which serves
the list of identity providers in the federation. It includes a cookie mechanism for the
user to easily find the last used identity providers.

An easy way to use it:

```python
# some_module/views.py
from social_edu_federation.django.views import EduFedIdpChoiceView


class CustomizedEduFederationIdpChoiceView(EduFedIdpChoiceView):
    """Display the list of all available Identity providers using our own template."""

    template_extends = "my_site/base.html"


# some_module/urls.py
from django.urls import path

from . import views

urlpatterns = [
    # ...
    path(
        "saml/renater_fer_idp_choice/",
        views.CustomizedEduFederationIdpChoiceView.as_view(backend_name="saml_fer"),
        name="saml_fer_idp_choice",
    ),
]
```

#### Testing views

`social-edu-federation` comes along with testing views to ease the development process.
Those testing views are to be used when you want to test the whole authentication loop on
your local computer.

How to plug the testing views in your project is not detailed here, but you can
try them (or see how they are plugged) by running the `social-edu-federation` tests suite.

Fetch the project:

```shell
git clone git@github.com:openfun/social-edu-federation.git
```

Create a virtual environment and install requirements:

```shell
cd social-edu-federation
pip install .[dev,django]
```

Run the standalone Django project:

```shell
make run_django
```

Open it in your browser.

##### Docker

In case you want to plug the testing views in your own project which is run in a Docker container
you will probably need to define the port used in the generated metadata. By default,
it will use the Django application port (let's say 8000) but if your mapping to the container
uses another port you have to define `SOCIAL_AUTH_SAML_FER_IDP_FAKER_DOCKER_PORT` setting
to provide the proper port.

E.g.:
 - Without override: metadata will be for `http://testserver:8000/saml/idp/sso/`
 - With `SOCIAL_AUTH_SAML_FER_IDP_FAKER_DOCKER_PORT=11000`,
   metadata will be for `http://testserver:11000/saml/idp/sso/`.


## Contributing

This project is intended to be community-driven, so please, do not hesitate to get in touch if you
have any question related to our implementation or design decisions.

We try to raise our code quality standards and expect contributors to follow the recommandations
from our [handbook](https://openfun.gitbooks.io/handbook/content).


## Versioning

This project follows [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).


## License

This work is released under the MIT License (see [LICENSE](./LICENSE)).

MIT License

Copyright (c) 2022 France Université Numérique

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openfun/social-edu-federation",
    "name": "social-edu-federation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python3-saml,python-social-auth,renater,shibboleth,Federation Education-Recherche",
    "author": "Open FUN (France Universite Numerique)",
    "author_email": "fun.dev@fun-mooc.fr",
    "download_url": "https://files.pythonhosted.org/packages/76/b8/f5fd59810e4cdbc214ba7e1c65e32d276a2fece6750ea76b5874df5c0cc5/social_edu_federation-2.1.0.tar.gz",
    "platform": null,
    "description": "# social-edu-federation: An SAML authentication backend for python-social-auth dedicated to education federation (RENATER)\n\n[![Python version](https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10-blue.svg)](https://www.python.org/)\n[![Django version](https://img.shields.io/badge/Django-3.2%20|%204.0-green.svg)](https://www.djangoproject.com/)\n[![CircleCI](https://circleci.com/gh/openfun/social-edu-federation/tree/main.svg?style=svg)](https://circleci.com/gh/openfun/social-edu-federation/tree/main)\n\n## Overview\n\nThis library provides an authentication backend which can be used with\n[Python Social Auth](https://github.com/python-social-auth/social-core)\nand optionally\n[Python Social Auth - Django](https://github.com/python-social-auth/social-app-django)\nto connect your application to an education SAML federation.\n\nBefore beginning, you must read the above documentations.\n\nFor now, it is only limited to the\n[RENATER](https://services.renater.fr/federation/en/documentation/generale/metadata/index)'s\n\"F\u00e9deration \u00c9ducation-Recherche\" (FER) federation.\n\n\n## Architecture\n\n`social-edu-federation` is divided in two parts:\n- The SAML backend and metadata parser, customized for the FER federation,\n  usable with Python Social Auth.\n- The Django integration which provides: base views to provide metadata, list available\n  Identity Providers and testing material for local development.\n\n\n### Authentication behavior\n\nThis library parses the metadata to extract base SAML authentication for each identity\nprovider in the federation metadata plus some extra information\n(see below *Setup - Core* section)\n\nThe authentication process can be summarized in few steps:\n\n- The federation metadata are parsed to fetch the identity providers list.\n- User choose an identity provider in the list with which they have an account and want to login.\n- The backend makes an SAML authentication request and redirects the user to the identity provider\n  \"single login\" page.\n- The user logs in on the identity provider website and is redirected to our (Service Provider) site.\n- The SAML FER backend will extract authentication data it needs from the authentication response\n  assertions.\n  The used assertions are:\n  - **urn:oid:2.5.4.4** (sn) aka (surname)\n    This represents the user's first name.\n  - **urn:oid:2.5.4.42** (givenName) aka (gn)\n    This represents the user's last name.\n  - **urn:oid:2.16.840.1.113730.3.1.241** (displayName)\n    This represents the user's full name.\n  - **urn:oid:0.9.2342.19200300.100.1.3** (mail)\n    Provides us the user email, we use it as email address and username.\n  - **urn:oid:1.3.6.1.4.1.5923.1.1.1.1** (eduPersonAffiliation)\n    Provides us the user's role(s) list.\n    This is not mandatory.\n\n  Fields we do not use:\n   - **urn:oid:1.3.6.1.4.1.7135.1.2.1.14** (supannEtablissement)\n\n  All fields are documented on\n  [Renater supann](https://services.renater.fr/documentation/supann/supann2021/recommandations/attributs/liste_des_attributs).\n- The authentication response passes through the \"Social auth\" pipeline.\n  `social-edu-federation` provides one extra step to replace the\n  `social_core.pipeline.user.create_user` original one. This step allows to have a fallback\n  on the user's *full name* if one of the *first name* or *last name* is not available.\n\n## Setup\n\n### Core\n\nYou may install only the library core which will provide you with:\n- The FER metadata parser (see `social_edu_federation.parser.FederationMetadataParser`)\n  which is an extension of the original `python3-saml`'s `OneLogin_Saml2_IdPMetadataParser`\n  and provides extra features as:\n  - Extract all the identity providers at once\n  - Extract extra information from each identity provider metadata (\n    the identity provider's display name,\n    the identity provider's organization name,\n    the identity provider's organization display name)\n- A basic \"metadata store\" which is not really helpful but organizes the process of fetching\n  the metadata and convert it to a Python Social Auth like object, usable by the authentication\n  backend.\n- The SAML authentication backend which is preconfigured to be used with the FER federation.\n\n```shell\n$ pip install social-edu-federation\n```\n\n### Django integration\n\nIf you also want to add this library into a Django project you may explicitly add the `django` extra while installing the library:\n\n```shell\n$ pip install social-edu-federation[django]\n```\n\nIt is also recommended to add `social_edu_federation.django.apps.PythonSocialEduFedAuthConfig`\nto your `INSTALLED_APPS` to get the following features:\n\n- A Django check which asserts the default \"metadata store\" is overridden.\n- The `prefetch_saml_fer_metadata` management command (see *Cache management* below).\n- The static files and Django views default templates (see *Using the default views* below).\n\n#### Cache management\n\nWhen using the Django integration, it is highly recommended to define a Django setting to\ntell `social_edu_federation` to use the \"metadata store with cache\". This will avoid fetching\nthe whole federation metadata everytime we need an information about one identity\nprovider.\n\n```python\n# settings.py\nSOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_STORE = \"social_edu_federation.django.metadata_store.CachedMetadataStore\"\n```\n\nThis \"metadata store\" will use the Django `default` cache which can be easily replaced by\nthe cache backend of your choice:\n\n```python\n# settings.py\nSOCIAL_AUTH_SAML_FER_DJANGO_CACHE = \"redis\"\n\nassert SOCIAL_AUTH_SAML_FER_DJANGO_CACHE in CACHES, \"cache backend name is not in settings.CACHES\"\n```\n\nIf you installed the `social_edu_federation` Django application, you will be able to\nfill the cache asynchronously using the `prefetch_saml_fer_metadata` management\ncommand, by defining a cron job which will call\n`django-admin prefetch_saml_fer_metadata saml_fer` to refresh the FER cache.\nUsing this make sure that no actual user has to wait for the full federation metadata to load\nloading time.\n\n#### Project setup\n\nFor a basic use of the FER backend for authentication you will need to define:\n\n```python\n# settings.py\nINSTALLED_APPS = [\n    # ...\n    \"social_django.apps.PythonSocialAuthConfig\",  # see python-social-auth\n    \"social_edu_federation.django.apps.PythonSocialEduFedAuthConfig\",\n]\nMIDDLEWARE = [\n    # ...\n    \"social_django.middleware.SocialAuthExceptionMiddleware\",  # At the end\n]\n\nAUTHENTICATION_BACKENDS = [\n    \"social_edu_federation.backends.saml_fer.FERSAMLAuth\",\n    \"django.contrib.auth.backends.ModelBackend\",  # only if you keep Django basic auth\n]\n\n# Python social auth\nSOCIAL_AUTH_JSONFIELD_ENABLED = True\n\nSOCIAL_AUTH_SAML_FER_SECURITY_CONFIG = {\n    \"authnRequestsSigned\": True,\n    \"signMetadata\": True,\n    \"wantAssertionsSigned\": True,\n    \"rejectDeprecatedAlgorithm\": True,\n}\n\n# Specific social_edu_federation\nSOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_STORE = \"social_edu_federation.django.metadata_store.CachedMetadataStore\"\n\n# SOCIAL_AUTH_SAML_FER_SP_ENTITY_ID should be a URL that includes a domain name you own\nSOCIAL_AUTH_SAML_FER_SP_ENTITY_ID = \"https://you-site.example/saml/metadata/\"\n# SOCIAL_AUTH_SAML_FER_SP_PUBLIC_CERT X.509 certificate for the key pair that\n# your app will use\nSOCIAL_AUTH_SAML_FER_SP_PUBLIC_CERT = \"MII...\"\n# SOCIAL_AUTH_SAML_FER_SP_PRIVATE_KEY The private key to be used by your app\nSOCIAL_AUTH_SAML_FER_SP_PRIVATE_KEY = \"MII...\"\n\n# Next certificate management, keep empty when next certificate is still not known\nSOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT = None\nSOCIAL_AUTH_SAML_FER_SP_EXTRA = (\n    {\n        \"x509certNew\": SOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT,\n    }\n    if SOCIAL_AUTH_SAML_FER_SP_NEXT_PUBLIC_CERT\n    else {}\n)\n\nSOCIAL_AUTH_SAML_FER_ORG_INFO = {  # specify values for English at a minimum\n    \"en-US\": {\n        \"name\": \"Organization name\",\n        \"displayname\": \"Organization display name\",\n        \"url\": \"https://you-site.example\",\n    }\n}\n# SOCIAL_AUTH_SAML_FER_TECHNICAL_CONTACT technical contact responsible for your app\nSOCIAL_AUTH_SAML_FER_TECHNICAL_CONTACT = {\n    \"givenName\": \"Dev team\",\n    \"emailAddress\": \"dev@example.com\",\n}\n# SOCIAL_AUTH_SAML_FER_SUPPORT_CONTACT support contact for your app\nSOCIAL_AUTH_SAML_FER_SUPPORT_CONTACT = {\n    \"givenName\": \"Dev team\",\n    \"emailAddress\": \"dev@example.com\",\n}\n# SOCIAL_AUTH_SAML_FER_ENABLED_IDPS is not required since the\n# SAML FER backend is overridden to allow dynamic IdPs.\n# see social_edu_federation.backends.saml_fer.FERSAMLAuth.get_idp(idp_name)\n\n# Custom parameter to define the FER Federation Metadata\nSOCIAL_AUTH_SAML_FER_FEDERATION_SAML_METADATA_URL = (\n    \"https://metadata.federation.renater.fr/renater/main/main-idps-renater-metadata.xml\"\n)\n\n# Use (or not) the default pipeline with the first/last name cleanup step\nfrom social_edu_federation.pipeline import DEFAULT_EDU_FED_AUTH_PIPELINE\nSOCIAL_AUTH_SAML_FER_PIPELINE = DEFAULT_EDU_FED_AUTH_PIPELINE\n```\n\n#### Using the default views\n\nTo make your Service Provider metadata publicly available, you will need to add\nthe following URL:\n\n```python\n# some_module/urls.py\nfrom django.urls import path\n\nfrom social_edu_federation.django.views import EduFedMetadataView\n\n\nurlpatterns = [\n    # ...\n    path(\n        \"saml/metadata/\",\n        EduFedMetadataView.as_view(backend_name=\"saml_fer\"),\n        name=\"saml_fer_metadata\",\n    ),\n]\n```\n\nYou may also want to have a look at the provided `EduFedIdpChoiceView` which serves\nthe list of identity providers in the federation. It includes a cookie mechanism for the\nuser to easily find the last used identity providers.\n\nAn easy way to use it:\n\n```python\n# some_module/views.py\nfrom social_edu_federation.django.views import EduFedIdpChoiceView\n\n\nclass CustomizedEduFederationIdpChoiceView(EduFedIdpChoiceView):\n    \"\"\"Display the list of all available Identity providers using our own template.\"\"\"\n\n    template_extends = \"my_site/base.html\"\n\n\n# some_module/urls.py\nfrom django.urls import path\n\nfrom . import views\n\nurlpatterns = [\n    # ...\n    path(\n        \"saml/renater_fer_idp_choice/\",\n        views.CustomizedEduFederationIdpChoiceView.as_view(backend_name=\"saml_fer\"),\n        name=\"saml_fer_idp_choice\",\n    ),\n]\n```\n\n#### Testing views\n\n`social-edu-federation` comes along with testing views to ease the development process.\nThose testing views are to be used when you want to test the whole authentication loop on\nyour local computer.\n\nHow to plug the testing views in your project is not detailed here, but you can\ntry them (or see how they are plugged) by running the `social-edu-federation` tests suite.\n\nFetch the project:\n\n```shell\ngit clone git@github.com:openfun/social-edu-federation.git\n```\n\nCreate a virtual environment and install requirements:\n\n```shell\ncd social-edu-federation\npip install .[dev,django]\n```\n\nRun the standalone Django project:\n\n```shell\nmake run_django\n```\n\nOpen it in your browser.\n\n##### Docker\n\nIn case you want to plug the testing views in your own project which is run in a Docker container\nyou will probably need to define the port used in the generated metadata. By default,\nit will use the Django application port (let's say 8000) but if your mapping to the container\nuses another port you have to define `SOCIAL_AUTH_SAML_FER_IDP_FAKER_DOCKER_PORT` setting\nto provide the proper port.\n\nE.g.:\n - Without override: metadata will be for `http://testserver:8000/saml/idp/sso/`\n - With `SOCIAL_AUTH_SAML_FER_IDP_FAKER_DOCKER_PORT=11000`,\n   metadata will be for `http://testserver:11000/saml/idp/sso/`.\n\n\n## Contributing\n\nThis project is intended to be community-driven, so please, do not hesitate to get in touch if you\nhave any question related to our implementation or design decisions.\n\nWe try to raise our code quality standards and expect contributors to follow the recommandations\nfrom our [handbook](https://openfun.gitbooks.io/handbook/content).\n\n\n## Versioning\n\nThis project follows [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).\n\n\n## License\n\nThis work is released under the MIT License (see [LICENSE](./LICENSE)).\n\nMIT License\n\nCopyright (c) 2022 France Universit\u00e9 Num\u00e9rique\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An SAML backend for python-social-auth dedicated to education federation (RENATER)",
    "version": "2.1.0",
    "split_keywords": [
        "python3-saml",
        "python-social-auth",
        "renater",
        "shibboleth",
        "federation education-recherche"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c3843b1624e427d7778895d7940f0e940d0d4fec881735054ca204cdb7dc199",
                "md5": "3e37ab1c5c22dee808574a70499da308",
                "sha256": "01f3eb344b60bab4eab1de04ef36672f3ca99437bdc4fcbb6f9495558493eeae"
            },
            "downloads": -1,
            "filename": "social_edu_federation-2.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3e37ab1c5c22dee808574a70499da308",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 37972,
            "upload_time": "2023-01-12T14:24:59",
            "upload_time_iso_8601": "2023-01-12T14:24:59.640720Z",
            "url": "https://files.pythonhosted.org/packages/3c/38/43b1624e427d7778895d7940f0e940d0d4fec881735054ca204cdb7dc199/social_edu_federation-2.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76b8f5fd59810e4cdbc214ba7e1c65e32d276a2fece6750ea76b5874df5c0cc5",
                "md5": "8f334291f68b46568931c279c358e8a8",
                "sha256": "d8ce5556a5c0ad242b54c716b0371d8b98249ce2432ac61053b14aaa407b8d67"
            },
            "downloads": -1,
            "filename": "social_edu_federation-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8f334291f68b46568931c279c358e8a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35079,
            "upload_time": "2023-01-12T14:25:01",
            "upload_time_iso_8601": "2023-01-12T14:25:01.083614Z",
            "url": "https://files.pythonhosted.org/packages/76/b8/f5fd59810e4cdbc214ba7e1c65e32d276a2fece6750ea76b5874df5c0cc5/social_edu_federation-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-12 14:25:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "openfun",
    "github_project": "social-edu-federation",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "tox": true,
    "lcname": "social-edu-federation"
}
        
Elapsed time: 0.03239s