An extremly simple example of a SAML2 identity provider.

There are 2 example IDPs in the project’s example directory: * idp2 has a static definition of users:

  • user attributes are defined in
  • the password is defined in the PASSWD dict in
  • idp2_repoze is using repoze.who middleware to perform authentication and attribute retrieval


Entity configuration is described in “Configuration of pysaml2 entities” Server parameters like host and port and various command line parameters are defined in the main part of


The folder [your path]/pysaml2/example/idp2 contains a file named

Take the file named and rename it

Generate a metadata file based in the configuration file ( by using the command: > idp.xml

Run IDP:

Open a Terminal:

cd [your path]/pysaml2/example/idp2
python idp_conf

Note that you should not have the .py extension on the while running the program