Auth365
Effortless asynchronous OAuth 2.0 client for popular platforms
Features
- Asynchronous: Built on top of
httpxis fully asynchronous. - Built-in support: For popular OAuth 2.0 providers like Google, Yandex, Telegram, etc.
- Extensible: Easily add support for new OAuth 2.0 providers.
- Easy to use: Simple and intuitive API.
Installation
pip install auth365
Get Started
from typing import Annotated
from fastapi import FastAPI, Depends
from starlette.responses import RedirectResponse
from auth365.providers.google import GoogleOAuth
from auth365.schemas import OAuth2Callback, OpenID
from examples.config import settings
app = FastAPI()
google_oauth = GoogleOAuth(
client_id=settings.google_client_id,
client_secret=settings.google_client_secret,
redirect_uri="http://localhost:8000/callback",
)
@app.get("/login")
async def login() -> RedirectResponse:
async with google_oauth:
url = await google_oauth.get_authorization_url()
return RedirectResponse(url=url)
@app.get("/callback")
async def oauth_callback(callback: Annotated[OAuth2Callback, Depends()]) -> OpenID:
async with google_oauth:
await google_oauth.authorize(callback)
return await google_oauth.userinfo()
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.
Metadata
Release files for auth365 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| auth365-0.1.2.tar.gz | 9.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auth365-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / auth365-0.1.2.tar.gz
| Download URL | auth365-0.1.2.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b14890468d151bc36fe9019efecfef12fce354debf96103940912fd6b750892
|
|
BLAKE2b-256 checksum How to use checksums |
d8b426f2ca1265238cb199d955b2d72a7251687ce5fe6b7a8774e3429833ea39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Windows/11
|
Release files / auth365-0.1.2-py3-none-any.whl
| Download URL | auth365-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56271940db0add8519d22ec0d7ee909fa2f5118e478192b8ba479fab5ab11dc3
|
|
BLAKE2b-256 checksum How to use checksums |
3c0c7cde9eceeb209e61b22564f8b46d3739068e76e7c0e8ce54d7c08bbbc271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Windows/11
|
Security for auth365 0.1.2
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.