fastapi-sso
FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)
What it is and what it does
FastAPI SSO is a FastAPI plugin that integrates OAuth-based single sign-on (SSO) authentication into your application. It abstracts away the complexity of OAuth flows and lets you add "Login with Google," "Login with Facebook," "Login with Microsoft," and many other provider buttons to your backend with minimal code. The package handles OAuth state validation, token exchange, and user identity verification.
The library supports both official providers (Google, Microsoft, Facebook, Spotify, Fitbit, Github, Notion, Twitter) and community-contributed providers (Kakao, Naver, Gitlab, Line, LinkedIn, Yandex, and others). It uses httpx for HTTP requests, oauthlib for OAuth protocol handling, and pyjwt for JWT token processing. As of version 0.16.0, it requires async context managers to prevent race conditions in concurrent login scenarios, and version 0.19.0 fixed a critical CSRF vulnerability by adding proper OAuth state validation.
Use it for:
- Add a "Login with Google" button to a FastAPI web application without implementing OAuth from scratch.
- Migrate user authentication from a custom system to federated identity using multiple social providers.
- Build a multi-tenant SaaS platform where users can sign up via their existing Google or Microsoft account.
- Implement passwordless authentication by delegating identity verification to trusted OAuth providers.
- Support enterprise login via Microsoft Office 365 accounts in an internal FastAPI application.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
FastAPI plugin that adds single sign-on (SSO) authentication to your application using OAuth providers like Google, Facebook, Microsoft, and others.
Yes. This package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It solves a common authentication problem with broad provider support. The recent security fixes (state validation in 0.19.0, race condition fix in 0.16.0) show responsive maintenance. Use it if you need OAuth SSO in FastAPI and are willing to adopt the async context manager pattern.
Install
fastapi-sso on PyPI
pip
pip install fastapi-ssouv
uv add fastapi-ssopoetry
poetry add fastapi-ssoInstalling fastapi-sso
Before you install
Low friction install with six stable runtime dependencies. Actively maintained with a recent release 53 days ago; repo shows 482 stars and last commit on 2026-08-10. Requires Python 3.10 or later.
License in practice
MIT license (permissive) means you can use this in commercial and proprietary projects with minimal restrictions—just include the license notice.
Quickstart
pip install fastapi-sso
from fastapi_sso.fastapi_sso import FastAPISSOBase
# Configure SSO with a provider (e.g., Google)
sso = FastAPISSOBase(client_id="...", client_secret="...", redirect_url="...")
# In your route handler:
async with sso:
user_info = await sso.verify_and_process(request)
Requires async context manager (async with) as of version 0.16.0; synchronous with is deprecated. Must configure OAuth credentials for your chosen provider.
Verify before relying
- Whether all listed providers (Google, Facebook, Microsoft, Spotify, Fitbit, Github, Notion, Twitter, and contributed providers) are equally well-tested and maintained.
- Performance characteristics and rate-limiting behavior when handling high-concurrency login flows.
- Whether the pluggable server-side state store mentioned for version 1.0.0 is already available or still planned.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — fastapi, httpx, oauthlib, pydantic, pyjwt, typing-extensions |
| Maintenance | actively maintained — 53 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,026,830/month — #1,796 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastapi_sso-0.21.1-py3-none-any.whl
Keywords: fastapi, sso, oauth, google, facebook, spotify, linkedin
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
fastapi-auth0Integrates Auth0 authentication into FastAPI…
permissive · top 15,000 on PyPI
django-google-ssoAdds Google OAuth 2.0 authentication to Django…
permissive · top 15,000 on PyPI
oauthenticatorOAuthenticator provides OAuth2 login handlers…
permissive · top 15,000 on PyPI
facebook-sdkA Python client library for the Facebook Graph…
permissive · top 15,000 on PyPI
fastapi-usersProvides ready-to-use user registration, login,…
permissive · top 5,000 on PyPI
fastapi-loginAdds session and token-based user…
permissive · top 15,000 on PyPI
django-allauthProvides integrated local and social…
permissive · top 5,000 on PyPI
social-auth-app-djangoIntegrates social authentication and…
permissive · top 5,000 on PyPI
django-auth-adfsIntegrates Django applications with Microsoft…
permissive · top 15,000 on PyPI
aioauthaioauth implements the OAuth 2.0 protocol for…
permissive · top 15,000 on PyPI