{"id":15044044,"url":"https://github.com/tomasvotava/fastapi-sso","last_synced_at":"2025-04-12T20:38:26.085Z","repository":{"id":37934119,"uuid":"346033602","full_name":"tomasvotava/fastapi-sso","owner":"tomasvotava","description":"FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)","archived":false,"fork":false,"pushed_at":"2024-10-28T01:08:19.000Z","size":788,"stargazers_count":336,"open_issues_count":21,"forks_count":52,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T21:55:59.264Z","etag":null,"topics":["facebook-authentication","fastapi","fastapi-oauth","google-authentication","microsoft-authentication","oauth","oauth2","python","spotify-authentication","sso","sso-authentication"],"latest_commit_sha":null,"homepage":"https://tomasvotava.github.io/fastapi-sso/","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/tomasvotava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-09T14:27:34.000Z","updated_at":"2024-10-28T23:26:52.000Z","dependencies_parsed_at":"2023-02-19T19:35:30.883Z","dependency_job_id":"ed409000-3b4a-4ff8-8aaa-ea774998c63b","html_url":"https://github.com/tomasvotava/fastapi-sso","commit_stats":{"total_commits":179,"total_committers":19,"mean_commits":9.421052631578947,"dds":0.5865921787709497,"last_synced_commit":"989ce0ceab42bc43bb2d6d2e04fd3e90f0668a87"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvotava%2Ffastapi-sso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvotava%2Ffastapi-sso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvotava%2Ffastapi-sso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasvotava%2Ffastapi-sso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasvotava","download_url":"https://codeload.github.com/tomasvotava/fastapi-sso/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631668,"owners_count":21136554,"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":["facebook-authentication","fastapi","fastapi-oauth","google-authentication","microsoft-authentication","oauth","oauth2","python","spotify-authentication","sso","sso-authentication"],"created_at":"2024-09-24T20:49:59.725Z","updated_at":"2025-04-12T20:38:26.049Z","avatar_url":"https://github.com/tomasvotava.png","language":"Python","readme":"# FastAPI SSO\n\n![Supported Python Versions](https://img.shields.io/pypi/pyversions/fastapi-sso)\n[![Test coverage](https://codecov.io/gh/tomasvotava/fastapi-sso/graph/badge.svg?token=SIFCTVSSOS)](https://codecov.io/gh/tomasvotava/fastapi-sso)\n![Tests Workflow Status](https://img.shields.io/github/actions/workflow/status/tomasvotava/fastapi-sso/test.yml?label=tests)\n![Lint Workflow Status](https://img.shields.io/github/actions/workflow/status/tomasvotava/fastapi-sso/lint.yml?label=ruff)\n![Mypy Workflow Status](https://img.shields.io/github/actions/workflow/status/tomasvotava/fastapi-sso/lint.yml?label=mypy)\n![Black Workflow Status](https://img.shields.io/github/actions/workflow/status/tomasvotava/fastapi-sso/lint.yml?label=black)\n![CodeQL Workflow Status](https://img.shields.io/github/actions/workflow/status/tomasvotava/fastapi-sso/codeql-analysis.yml?label=CodeQL)\n![PyPi weekly downloads](https://img.shields.io/pypi/dw/fastapi-sso)\n![Project License](https://img.shields.io/github/license/tomasvotava/fastapi-sso)\n![PyPi Version](https://img.shields.io/pypi/v/fastapi-sso)\n\nFastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via\nMicrosoft Office 365 account).\n\nThis allows you to implement the famous `Login with Google/Facebook/Microsoft` buttons functionality on your\nbackend very easily.\n\n**Documentation**: [https://tomasvotava.github.io/fastapi-sso/](https://tomasvotava.github.io/fastapi-sso/)\n\n**Source Code**: [https://github.com/tomasvotava/fastapi-sso](https://github.com/tomasvotava/fastapi-sso/)\n\n## Demo site\n\nAn awesome demo site was created and is maintained by even awesomer\n[Chris Karvouniaris (@chrisK824)](https://github.com/chrisK824). Chris has also posted multiple\nMedium articles about FastAPI and FastAPI SSO.\n\nBe sure to see his tutorials, follow him and show him some appreciation!\n\nPlease see his [announcement](https://github.com/tomasvotava/fastapi-sso/discussions/150) with all the links.\n\nQuick links for the eager ones:\n\n- [Demo site](https://fastapi-sso-example.vercel.app/)\n- [Medium articles](https://medium.com/@christos.karvouniaris247)\n\n## Security Notice\n\n### Version `0.16.0` Update: Race Condition Bug Fix \u0026 Context Manager Change\n\nA race condition bug in the login flow that could, in rare cases, allow one user\nto assume the identity of another due to concurrent login requests was recently discovered\nby [@parikls](https://github.com/parikls).\nThis issue was reported in [#186](https://github.com/tomasvotava/fastapi-sso/issues/186) and has been resolved\nin version `0.16.0`.\n\n**Details of the Fix:**\n\nThe bug was mitigated by introducing an async lock mechanism that ensures only one user can attempt the login\nprocess at any given time. This prevents race conditions that could lead to unintended user identity crossover.\n\n**Important Change:**\n\nTo fully support this fix, **users must now use the SSO instance within an `async with`\ncontext manager**. This adjustment is necessary for proper handling of asynchronous operations.\n\nThe synchronous `with` context manager is now deprecated and will produce a warning.\nIt will be removed in future versions to ensure best practices for async handling.\n\n**Impact:**\n\nThis bug could potentially affect deployments with high concurrency or scenarios where multiple users initiate\nlogin requests simultaneously. To prevent potential issues and deprecation warnings, **update to\nversion `0.16.0` or later and modify your code to use the async with context**.\n\nCode Example Update:\n\n```python\n# Before (deprecated)\nwith sso:\n    openid = await sso.verify_and_process(request)\n\n# After (recommended)\nasync with sso:\n    openid = await sso.verify_and_process(request)\n```\n\nThanks to both [@parikls](https://github.com/parikls) and the community for helping me identify and improve the\nsecurity of `fastapi-sso`. If you encounter any issues or potential vulnerabilities, please report them\nimmediately so they can be addressed.\n\nFor more details, refer to Issue [#186](https://github.com/tomasvotava/fastapi-sso/issues/186)\nand PR [#189](https://github.com/tomasvotava/fastapi-sso/pull/189).\n\n## Support this project\n\nIf you'd like to support this project, consider [buying me a coffee ☕](https://www.buymeacoffee.com/tomas.votava).\nI tend to process Pull Requests faster when properly caffeinated 😉.\n\n\u003ca href=\"https://www.buymeacoffee.com/tomas.votava\" target=\"_blank\"\u003e\n\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\"\n    alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n## Supported login providers\n\n### Official\n\n- Google\n- Microsoft\n- Facebook\n- Spotify\n- Fitbit\n- Github (credits to [Brandl](https://github.com/Brandl) for hint using `accept` header)\n- generic (see [docs](https://tomasvotava.github.io/fastapi-sso/reference/sso.generic/))\n- Notion\n- Twitter (X)\n\n### Contributed\n\n- Kakao (by Jae-Baek Song - [thdwoqor](https://github.com/thdwoqor))\n- Naver (by 1tang2bang92) - [1tang2bang92](https://github.com/1tang2bang92)\n- Gitlab (by Alessandro Pischedda) - [Cereal84](https://github.com/Cereal84)\n- Line (by Jimmy Yeh) - [jimmyyyeh](https://github.com/jimmyyyeh)\n- LinkedIn (by Alessandro Pischedda) - [Cereal84](https://github.com/Cereal84)\n- Yandex (by Akim Faskhutdinov) – [akimrx](https://github.com/akimrx)\n- Seznam (by Tomas Koutek) - [TomasKoutek](https://github.com/TomasKoutek)\n- Discord (by Kaelian Baudelet) - [afi-dev](https://github.com/afi-dev)\n- Bitbucket (by Kaelian Baudelet) - [afi-dev](https://github.com/afi-dev)\n\nSee [Contributing](#contributing) for a guide on how to contribute your own login provider.\n\n## Installation\n\n### Install using `pip`\n\n```console\npip install fastapi-sso\n```\n\n### Install using `poetry`\n\n```console\npoetry add fastapi-sso\n```\n\n## Contributing\n\nIf you'd like to contribute and add your specific login provider, please see\n[Contributing](https://tomasvotava.github.io/fastapi-sso/contributing) file.\n","funding_links":["https://www.buymeacoffee.com/tomas.votava"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasvotava%2Ffastapi-sso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasvotava%2Ffastapi-sso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasvotava%2Ffastapi-sso/lists"}