skillfed

fastapi-sso

FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)

fastapi-sso v0.21.1 7.0M downloads/30d#1,796 on PyPI482
Permissive license MIT Active released

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-sso

uv

uv add fastapi-sso

poetry

poetry add fastapi-sso

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

fastapi oauth loginsso authentication providergoogle facebook microsoft loginfastapi oauth2 integrationsocial login fastapioauth state validationfastapi identity provider
oauth-ssoauthenticationidentity-provider

More WWW/HTTP packages