Commit Graph

304 Commits

Author SHA1 Message Date
Benjamin Dauvergne 86d79ec00f msp: add missing static files 2013-10-15 23:23:53 +02:00
Benjamin Dauvergne 7895896147 msp/views: remove remaining reference to SSOViewMixin 2013-10-11 22:53:05 +02:00
Benjamin Dauvergne 3271f13807 msp: remove SSOViewMixin and reduce scope required for sso views 2013-10-11 22:52:15 +02:00
Benjamin Dauvergne 6e1817dc85 add msp integration application
Requirements
============

Your base template must use django-sekizai and must contain a sekizai block named
"css" and another named "js" respectively for stylesheet and javascript files.

Installation
============

Add the application to your installed apps::

   INSTALLED_APPS += ( 'msp', )

Install the authentication backend::

   AUTHENTICATION_BACKENDS += ( 'msp.backends.MspBackend', )

Define needed settings, we show here the default values::

   MSP_AUTHORIZE_URL = 'https://mon.service-public.fr/apis/app/oauth/authorize'
   MSP_TOKEN_URL = 'https://mon.service-public.fr/apis/app/oauth/token'
   MSP_API_URL = 'https://mon.service-public.fr/apis/'
   MSP_CLIENT_ID = 'id assigned by DIMAP'
   MSP_CLIENT_SECRET = 'secret assigned by DIMAP'
   MSP_CLIENT_CERTIFICATE = ('/my-path/my-certificate.crt', '/my-path/my-certificate.key')
   MSP_VERIFY_CERTIFICATE = False

You must plug the application views in your urls.py file by adding this
content::

   url(r'^msp/', include('msp.urls')),

To link your account to MSP or unlink your account from MSP, add the following
content to your template::

   {% include 'msp/linking.html' %}

It will show a linking link when unauthenticated and when no msp account is
linked to the current account or an unlinking link when authenticated and a
to MSP exists.

To show a connection box include this content in your template::

   {% include 'msp/connecting.html' %}

To make the include file use a popup to talk to MSP add the popup parameter
like in the following content::

   {% include 'msp/connecting.html' with popup=1 %}
2013-10-11 22:05:21 +02:00