Easy to integrate OAuth2 authentication with support for several identity providers.
Project description
fastapi-oauth2
FastAPI OAuth2 is a middleware-based social authentication mechanism supporting several OAuth2 providers. It leverages the social-core authentication backends and integrates seamlessly with FastAPI applications.
Integration
For integrating the package into an existing FastAPI application, the router with OAuth2 routes and
the OAuth2Middleware
with particular configs
should be added to the application.
from fastapi import FastAPI
from fastapi_oauth2.middleware import OAuth2Middleware
from fastapi_oauth2.router import router as oauth2_router
app = FastAPI()
app.include_router(oauth2_router)
app.add_middleware(OAuth2Middleware, config=OAuth2Config(...))
Contribute
Any contribution is welcome. Always feel free to open an issue or a discussion if you have any questions not covered by the documentation. If you have any ideas or suggestions, please, open a pull request. Your name will shine in our contributors' list. Be proud of what you build!
License
Copyright (C) 2023 Artyom Vancyan. MIT
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file fastapi_oauth2-1.3.0.tar.gz
.
File metadata
- Download URL: fastapi_oauth2-1.3.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c8135b571af9f882cc94a23afd271107e7a963a966213113a0c0ce0a22ba91c |
|
MD5 | dd206dedb0ff65cece04dcdaa63c5edc |
|
BLAKE2b-256 | 6b0cbc1b22b2f9b8d485d2ca843d7ea53b5cfc86cf9887ed4339445a192c0e8c |
File details
Details for the file fastapi_oauth2-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_oauth2-1.3.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4acdc81ba6e656a340a9b7f8f4e8dccd3974b3df30596d760eb88c1cf721272e |
|
MD5 | 3fec54de0bf33f5ac18591d7e14a30c6 |
|
BLAKE2b-256 | d75d0ffec625ac4cb4813af29993d9e187a2238990d6053f66e91beed4dfdefc |