Skip to content

simevo/spid-php-lib-example

Repository files navigation

SPID

Join the #spid-php channel Get invited SPID on forum.italia.it Build Status

spid-php-lib-example

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.

Getting Started

Tested on: amd64 Debian 10 (buster, current stable) with Docker 18.09 and Docker Compose 1.21.

  1. Install prerequisites:
sudo apt install docker.io docker-compose
  1. Run docker-compose up --build

  2. Visit the SP homepage http://localhost:8099/ and click login (user: test, password: test)

  3. Visit the IdP homepage http://localhost:8088/ to review its configuration.

This screencast shows what you should see if all goes well:

img

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

Refreshing key/certificate pairs

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

Authors

Lorenzo Cattaneo and Paolo Greppi, simevo s.r.l.

License

Copyright (c) 2018-2020, Developers Italia

License: BSD 3-Clause, see LICENSE file.

About

Demo application based on spid-php-lib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published