This repository contains a basic demo application based on spid-php-lib, easy to setup thanks to Docker Compose.
The supplied docker-compose.yml file defines and runs a two-container Docker application that comprises:
- this SPID Service Provider (SP) example
- and the SPID test Identity Provider (IdP) spid-testenv2 configured to talk to each other.
Tested on: amd64 Debian 10 (buster, current stable) with Docker 18.09 and Docker Compose 1.21.
- Install prerequisites:
sudo apt install docker.io docker-compose
-
Run
docker-compose up --build
-
Visit the SP homepage http://localhost:8099/ and click
login
(user:test
, password:test
) -
Visit the IdP homepage http://localhost:8088/ to review its configuration.
This screencast shows what you should see if all goes well:
To stop the two containers and remove them and all the other bits created by docker-compose up
, run the command:
docker-compose down
If you relaunch the docker-compose after a while, make sure you run it with the latest version of the SPID test IdP:
docker pull italia/spid-testenv2
If on visiting http://localhost:8099/login you get "Errori di validazione. Il certificato è scaduto.", refresh key/certificate pairs for SP and IdP:
openssl req -x509 -nodes -sha256 -subj '/C=IT' -newkey rsa:2048 -keyout idp_conf/idp.key -out idp_conf/idp.crt
openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -subj "/C=IT/ST=Italy/L=Milan/O=myservice/CN=localhost" -keyout sp_conf/sp.key -out sp_conf/sp.crt
wget http://localhost:8099/metadata -O idp_conf/sp_metadata.xml
wget http://localhost:8088/metadata -O sp_conf/idp_testenv2.xml
Lorenzo Cattaneo and Paolo Greppi, simevo s.r.l.
Copyright (c) 2018-2020, Developers Italia
License: BSD 3-Clause, see LICENSE file.