pysaml2 7.5.0


Python implementation of SAML Version 2 Standard

PySAML2 is a Python library that provides a complete implementation of the SAML Version 2 standard. It is designed to assist developers in building either a SAML2 Service Provider or an Identity Provider. The library is versatile and can be used in a WSGI environment, with extensions available for integration with other frameworks. PySAML2 relies on the xmlsec binary, which is readily available in most Linux distributions and can be installed on macOS through Homebrew. The library is actively maintained by the IdentityPython community, which provides a space for developers to discuss and contribute to the development of identity-related Python tools.

Stars: 538, Watchers: 538, Forks: 418, Open Issues: 104

The IdentityPython/pysaml2 repo was created 11 years ago and the last code push was 4 days ago.
The project is popular with 538 github stars!

How to Install pysaml2

You can install pysaml2 using pip

pip install pysaml2

or add it to a project with poetry

poetry add pysaml2

Package Details

GitHub Repo:


  • Software Development/Libraries/Python Modules
No  pysaml2  pypi packages just yet.


A list of common pysaml2 errors.

Code Examples

Here are some pysaml2 code examples and snippets.

GitHub Issues

The pysaml2 package has 104 open issues on GitHub

  • where to change Encryption Algorithm Negotiation List
  • Signature verfication failed. Invalid document format
  • Bump certifi from 2023.5.7 to 2023.7.22
  • Bump cryptography from 41.0.1 to 41.0.2
  • Import Error ”path” from dependencies lib ”importlib-resources”.
  • Remove utility from packaging
  • Shipping "utility" seems wrong
  • Turn warning about no signature verification into an error

See more issues on GitHub

Related Packages & Articles

django-saml2-auth 2.2.1

Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta

django-allauth 0.61.1

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.

oauthlib 3.2.2

A generic, spec-compliant, thorough implementation of the OAuth request-signing logic

authx 1.1.0

Ready to use and customizable Authentications and Oauth2 management for FastAPI