https://github.com/everysoftware/fastlink
FastLink OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible
https://github.com/everysoftware/fastlink
fastapi httpx oauth2
Last synced: 3 months ago
JSON representation
FastLink OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible
- Host: GitHub
- URL: https://github.com/everysoftware/fastlink
- Owner: everysoftware
- License: mit
- Created: 2025-01-27T09:15:35.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-05-23T22:24:44.000Z (5 months ago)
- Last Synced: 2025-07-02T13:04:03.298Z (3 months ago)
- Topics: fastapi, httpx, oauth2
- Language: Python
- Homepage:
- Size: 699 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# FastLink
_OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible_
---
[](https://github.com/everysoftware/fastlink/actions/workflows/test.yml)
[](https://github.com/everysoftware/fastlink/actions/workflows/codeql.yml)---
## 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
```bash
pip install fastlink
```## Get Started
```python
from typing import Annotated, Anyfrom fastapi import Depends, FastAPI
from fastapi.responses import RedirectResponsefrom examples.config import settings
from fastlink import GoogleSSO
from fastlink.schemas import OAuth2Callback, OpenIDapp = 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.

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.
