Skip to content

archetipo/python-spid-service-provider

Repository files navigation

Introduction

WIP WIP

This is a minimalist example for italian Spid SAML Service Provider service written using Flask and implementa a hard refactoring of python3-saml. Only for test purpose.

Requirements

You will also need a development environment capable of compiling Python packages and the "libffi" and "libxmlsec1" development libraries, which are needed by python3-saml.

Instructions for installing these development libraries will differ depending on your host operating system.

How to build and run with Docker

These instructions allow you to test this project with spid-testnv2 and create SP metadata that pass all checks of spid saml check.

Spid Saml Check https check, pass only if you run this project under https url.

  1. Clone repo

    git clone https://github.com/archetipo/python-spid-service-provider.git
  2. go to folrder

    cd python-spid-service-provider
  3. make certs

    go to saml/certs and type

    $ openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout sp.key -out sp.crt
  4. make settings

    cp settings.json.example saml/settings.json
    cp advanced_settings.json.example saml/advanced_settings.json

    in settings.json type

     base_url_sp = IP:5000 or host of this project
     base_url_idp =  url where spid-testenv2 running
     x509_idp = read this data from spid-testenv2 metadata 
    
    $ openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout sp.key -out sp.crt

    in advanced_settings.json edit the IPACode this field is mandatory for spid saml check

  5. build Docker image

    docker build -t spid-sp-test .
  6. run container:

    docker run -p 5000:5000 spid-sp-test

Check with spid-saml-check

Follow the instructions for build and run [spid-saml-check] (https://github.com/italia/spid-saml-check)

Testing with spid-testenv2

The fastest way to test this example SAML SP is to use the spid-testenv2 service.

Here is how:

  1. Configure and Start Idp spid-testenv2

    Configure and install spid-testenv2

Contact

Updates or corrections to this document are very welcome. Feel free

Additionally, comments or questions can be sent to: [email protected]

License

LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

Author Information

Alessio Gerace 2018-2020

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages