Friday, April 25, 2014

Running the pysaml2 example

Because of a lack of documentations, running the pysaml2 example code is a little bit tricky:

0. Clone the pysaml2 project repo to get the example code:

trinh@trinh-pc:~$ git clone

1. You need to install pysaml2 and all of it dependencies, especially the xmlsec1 lib:

trinh@trinh-pc:~$ sudo apt-get install xmlsec1

(myvenv)trinh@trinh-pc:~$ pip install pysaml2

For more information, read this blog post:

2. Install cherrypy:

(myvenv)trinh@trinh-pc:~$ pip install cherrypy

3. Go the example code directory, and start the webserver:

(myvenv)trinh@trinh-pc:~$ cd /pysaml2/example/
(myvenv)trinh@trinh-pc:/pysaml2/example$ ./ start

4. Now, access the service provider in the web browser with this url:


You will be directed to authenticating process and get the information of the user account:

5. To stop the server:

(myvenv)trinh@trinh-pc:/pysaml2/example$ ./ stop