SSOReady-Python
ssoready is a Python SDK for the SSOReady API.
SSOReady is a set of open-source dev tools for implementing Enterprise SSO. You can use SSOReady to add SAML support to your product this afternoon, for free, forever. You can think of us as an open source alternative to products like Auth0 or WorkOS.
This library includes type definitions for all request and response fields, and
offers both synchronous and asynchronous clients powered by httpx.
Installation
Add this dependency to your project's build file:
pip install ssoready
# or
poetry add ssoready
Usage
For full documentation, check out https://ssoready.com/docs.
At a super high level, all it takes to add SAML to your product is to:
- Sign up on app.ssoready.com for free
- From your login page, call
get_saml_redirect_urlwhen you want a user to sign in with SAML - Your user gets redirected back to a callback page you choose, e.g.
your-app.com/ssoready-callback?saml_access_code=.... You callredeem_saml_access_codewith thesaml_access_codeand log them in.
Import and construct a SSOReady client like this:
from ssoready.client import SSOReady
client = SSOReady() # loads your API key from the env var SSOREADY_API_KEY
# or
client = SSOReady(api_key="ssoready_sk_...")
Calling the get_saml_redirect_url endpoint looks like this:
# this is how you implement a "Sign in with SSO" button
redirect_url = client.get_saml_redirect_url(
# the ID of the organization/workspace/team (whatever you call it)
# you want to log the user into
organization_external_id="..."
).redirect_url
# redirect the user to `redirect_url`...
And using redeem_saml_access_code looks like this:
# this goes in your handler for POST /ssoready-callback
redeem_result = client.saml.redeem_saml_access_code(saml_access_code="saml_access_code_...")
email = redeem_result.email
organization_external_id = redeem_result.organization_external_id
# log the user in as `email` inside `organizationExternalId`...
Check out the quickstart for the details spelled out more concretely. The whole point of SSOReady is to make enterprise SSO super obvious and easy.
Async Client
You an also use asyncio with this SDK. Do so by using AsyncSSOReady instead of
SSOReady.
from ssoready.client import AsyncSSOReady
client = AsyncSSOReady()
async def main() -> None:
await client.saml.get_redirect_url(organization_external_id="...")
asyncio.run(main())
All methods available on the sync SSOReady client are also available on
AsyncSSOReady.
Contributing
Issues and PRs are more than welcome. Be advised that this library is largely
autogenerated from
ssoready/fern-config. Most code
changes ultimately need to be made there, not on this repo.
Metadata
Release files for ssoready 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ssoready-1.1.0.tar.gz | 19.5 kB | Without provenance | Details for ssoready-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ssoready-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for ssoready-1.1.0-py3-none-any.whl |
Total release size: 67.1 kB
Release files / ssoready-1.1.0.tar.gz
| Download URL | ssoready-1.1.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f5f049a9b5a32b453498b33023e48bc753051ecefefa68b6a504c751d4ac4e3
|
|
BLAKE2b-256 checksum How to use checksums |
72c8d0bc39f1c2adcd4f32137b6e339feffc274724dcacb0752efece19d25796
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.8.18 Linux/5.15.0-1070-azure
|
Release files / ssoready-1.1.0-py3-none-any.whl
| Download URL | ssoready-1.1.0-py3-none-any.whl |
|---|---|
| Size | 47.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5a2f8e9a8753f35475d8afd5866689294eee7268e2f36fa250ef78d30442f26
|
|
BLAKE2b-256 checksum How to use checksums |
512882c79612f05f89ee00fee6a1a91a2b2e0031380b2d9bbeac97bf02e06117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.8.18 Linux/5.15.0-1070-azure
|
Security for ssoready 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.