Skip to content

Example SAML Service Provider for Python/Flask using PySAML2

License

Notifications You must be signed in to change notification settings

nshobayo/okta-pysaml2-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is an example SAML SP service written using Flask and pysaml2.

Requirements

Installation

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt 

Running

$ python app.py 

Testing

The fastest way to test this example SAML SP is to use the saml.oktadev.com service.

Here is how:

  1. Edit the "app.py" file and uncomment the line in the "test" line in "metadata_url_for" dictionary.

    $ $EDITOR app.py

    Change this line:

    # 'test': 'http://idp.oktadev.com/metadata',                                                                                                

    To this:

    'test': 'http://idp.oktadev.com/metadata',
  2. Start the example SAML SP

    $ python app.py
  3. Start ngrok on the port that the example SAML SP is running on. By default, the example SAML SP runs on TCP 5000.

    $ ngrok http 5000

    You will need to install ngrok if you haven't already.

    Here is what it should look like:

    img

  4. Run saml.oktadev.com to test this example SAML SP

Testing the security of your SAML SP

After successfully completing the steps in the "Testing" section above, select the "Run security validation" option to have saml.oktadev.com run an extended series of security tests against your SAML SP.

Contact

Updates or corrections to this document are very welcome. Feel free to send pull requests with suggestions.

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

About

Example SAML Service Provider for Python/Flask using PySAML2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 77.0%
  • HTML 23.0%