Python SSO: pysaml2 and python3-saml

I am new to SSO and I just tried pysaml2 .

I also have the python3-saml library python3-saml (and its python-saml Python python-saml Python 2).

I need to use one of them with Shibboleth, if appropriate.

What are the pros and cons of pysaml2 and python3-saml ?


Update:

As of 2019, I still consider python3-saml the best option if you need to implement SP. This is not perfect (sorry @smartin, hehe), but it will give you much less headache than pysaml2.

+6
source share
1 answer

Both projects are compatible with Shibboleth.

pysaml2 is older than python3-saml, py2 and py3 are supported right now. Both are active and documented.

python3-saml follows the structure of the Onelogin SAML toolkit, so if you used any other toolkit ( php-saml , ruby-saml , java-saml ) before, it will be easy for you to deal with it (similar methods, same settings).

Differences

Crypto:

  • pysaml2 uses a pycryptodome as a dependecy for cryptography processing and implements its own xmldsig and xmlenc (for managing signatures and encryption in XML).
  • python3-saml uses python-xmlsec as a dependecy and delegates the signature / encryption of the XML elements to it.

Functions:

  • pysaml2 allows you to deploy an identity provider or service provider
  • python3-saml is service provider oriented

Settings:

In my opinion, python3-saml is simpler than pysaml2, the settings are more accurate, and its repo contains code examples on how to integrate django or flask and a guide to docs .

Note. I am the author of python3-saml

+5
source

Source: https://habr.com/ru/post/1259783/


All Articles