Skip to main content

FastLink

OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible


Test CodeQL Advanced


Features

  • All-in-one: Supports popular platforms like Google, Yandex, Telegram, etc.
  • Asynchronous: Built on top of httpx is fully asynchronous.
  • Easy-to-use: Simple and intuitive API for quick integration.
  • Extensible: Easily add support for new platforms or customize existing ones.

Installation

pip install fastlink

Get Started

from typing import Annotated, Any

from fastapi import Depends, FastAPI
from fastapi.responses import RedirectResponse

from examples.config import settings
from fastlink import GoogleSSO
from fastlink.schemas import OAuth2Callback, OpenID

app = FastAPI()

sso = GoogleSSO(
    settings.google_client_id,
    settings.google_client_secret,
    "http://localhost:8000/callback",
)


@app.get("/login")
async def login() -> RedirectResponse:
    async with sso:
        url = await sso.login_url()
        return RedirectResponse(url=url)


@app.get("/callback")
async def callback(call: Annotated[OAuth2Callback, Depends()]) -> OpenID:
    async with sso:
        return await sso.callback(call)

Now you can run the server and visit http://localhost:8000/login to start the OAuth 2.0 flow.

screenshot-1738081195921.png

After logging into Google, you will be redirected to the callback URL. The server will then fetch the user's OpenID information and return it as a response. screenshot-1738081352079.png

Release files for fastlink 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastlink 0.1.6
File Size Uploaded Provenance
fastlink-0.1.6.tar.gz 12.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fastlink 0.1.6
File Interpreter ABI Platform
fastlink-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Security for fastlink 0.1.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page