{"id":21166897,"url":"https://github.com/ssoready/ssoready-python","last_synced_at":"2025-07-09T17:33:07.610Z","repository":{"id":253022900,"uuid":"805408044","full_name":"ssoready/ssoready-python","owner":"ssoready","description":"Python SDK for SSOReady. Add SAML + SCIM support to any Python application this afternoon.","archived":false,"fork":false,"pushed_at":"2024-11-18T21:35:06.000Z","size":66,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-18T22:41:46.466Z","etag":null,"topics":["saml","scim","sso"],"latest_commit_sha":null,"homepage":"https://ssoready.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssoready.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-24T14:04:05.000Z","updated_at":"2024-11-18T21:54:18.000Z","dependencies_parsed_at":"2024-10-31T21:23:39.839Z","dependency_job_id":"bbec086a-936f-44b9-a790-5de6a7a2a70f","html_url":"https://github.com/ssoready/ssoready-python","commit_stats":null,"previous_names":["ssoready/ssoready-python"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssoready%2Fssoready-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssoready","download_url":"https://codeload.github.com/ssoready/ssoready-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225579007,"owners_count":17491280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["saml","scim","sso"],"created_at":"2024-11-20T14:56:32.888Z","updated_at":"2024-11-20T14:56:33.485Z","avatar_url":"https://github.com/ssoready.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://i.imgur.com/OhtkhbJ.png)\n\n# SSOReady-Python: SAML \u0026 SCIM for Python\n\n[![](https://img.shields.io/pypi/v/ssoready)](https://pypi.org/project/ssoready/)\n\n`ssoready` is a Python SDK for the [SSOReady](https://ssoready.com) API.\n\nSSOReady is a set of open-source dev tools for implementing Enterprise SSO. You\ncan use SSOReady to add SAML and SCIM support to your product this afternoon.\n\nFor example applications built using SSOReady-Python, check out:\n\n- [SSOReady Example App: Python + Django with SAML](https://github.com/ssoready/ssoready-example-app-python-django-saml)\n- [SSOReady Example App: Python + Flask with SAML](https://github.com/ssoready/ssoready-example-app-python-flask-saml)\n- [SSOReady Example App: Python + FastAPI with SAML](https://github.com/ssoready/ssoready-example-app-python-fastapi-saml)\n\n## Installation\n\nAdd this dependency to your project's build file:\n\n```bash\npip install ssoready\n# or\npoetry add ssoready\n```\n\n## Usage\n\nThis section provides a high-level overview of how SSOReady works, and how it's\npossible to implement SAML and SCIM in just an afternoon. For a more thorough\nintroduction, visit the [SAML\nquickstart](https://ssoready.com/docs/saml/saml-quickstart) or the [SCIM\nquickstart](https://ssoready.com/docs/scim/scim-quickstart).\n\nThe first thing you'll do is create a SSOReady client instance:\n\n```python\nfrom ssoready.client import SSOReady\n\nclient = SSOReady() # loads your API key from the env var SSOREADY_API_KEY\n```\n\n### SAML in two lines of code\n\nSAML (aka \"Enterprise SSO\") consists of two steps: an _initiation_ step where\nyou redirect your users to their corporate identity provider, and a _handling_\nstep where you log them in once you know who they are.\n\nTo initiate logins, you'll use SSOReady's [Get SAML Redirect\nURL](https://ssoready.com/docs/api-reference/saml/get-saml-redirect-url)\nendpoint:\n\n```python\n# this is how you implement a \"Sign in with SSO\" button\nredirect_url = client.saml.get_saml_redirect_url(\n    # the ID of the organization/workspace/team (whatever you call it)\n    # you want to log the user into\n    organization_external_id=\"...\"\n).redirect_url\n\n# redirect the user to `redirect_url`...\n```\n\nYou can use whatever your preferred ID is for organizations (you might call them\n\"workspaces\" or \"teams\") as your `organization_external_id`. You configure those\nIDs inside SSOReady, and SSOReady handles keeping track of that organization's\nSAML and SCIM settings.\n\nTo handle logins, you'll use SSOReady's [Redeem SAML Access\nCode](https://ssoready.com/docs/api-reference/saml/redeem-saml-access-code) endpoint:\n\n```python\n# this goes in your handler for POST /ssoready-callback\nredeem_result = client.saml.redeem_saml_access_code(saml_access_code=\"saml_access_code_...\")\n\nemail = redeem_result.email\norganization_external_id = redeem_result.organization_external_id\n\n# log the user in as `email` inside `organizationExternalId`...\n```\n\nYou configure the URL for your `/ssoready-callback` endpoint in SSOReady.\n\n### SCIM in one line of code\n\nSCIM (aka \"Enterprise directory sync\") is basically a way for you to get a list\nof your customer's employees offline.\n\nTo get a customer's employees, you'll use SSOReady's [List SCIM\nUsers](https://ssoready.com/docs/api-reference/scim/list-scim-users) endpoint:\n\n```python\nlist_scim_users_response = client.scim.list_scim_users(\n    organization_external_id=\"my_custom_external_id\"\n)\n\n# create users from each scim user\nfor scim_user in list_scim_users_response.scim_users:\n    # every scim_user has an id, email, attributes, and deleted\n```\n\n## Contributing\n\nIssues and PRs are more than welcome. Be advised that this library is largely\nautogenerated from [`ssoready/docs`](https://github.com/ssoready/docs). Most\ncode changes ultimately need to be made there, not on this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoready%2Fssoready-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssoready%2Fssoready-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssoready%2Fssoready-python/lists"}