FastLink OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible
Project description
FastLink
OAuth 2.0 client for various platforms, asynchronous, easy-to-use, extensible
Features
- All-in-one: Supports popular platforms like Google, Yandex, Telegram, etc.
- Asynchronous: Built on top of
httpxis 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
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.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastlink-0.1.5.tar.gz.
File metadata
- Download URL: fastlink-0.1.5.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e0d73e2b667d0e56b06a6fed91a11a05ef3f3e797255c0dac58faeabff3496b
|
|
| MD5 |
07eb7c1e39bb833d69c81096db659f62
|
|
| BLAKE2b-256 |
76158209071f5e79360ed0bf899418d24b5cf0b79b835873b3eb13d014874fc9
|
File details
Details for the file fastlink-0.1.5-py3-none-any.whl.
File metadata
- Download URL: fastlink-0.1.5-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e02f8d2bccaaa0875cf0bdd14be4701d5680885543f95e0f976fae307b60d880
|
|
| MD5 |
813e9b74d2e7ecbb63c235210264ce1e
|
|
| BLAKE2b-256 |
e71e61ec03787c64d039d3581262da259113bf0f6495cde7a06424e1d13e513e
|