Skip to main content

Easy to integrate OAuth2 authentication with support for several identity providers.

Project description

fastapi-oauth2

PyPI Playground Python FastAPI Tests Docs

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_oauth2-1.3.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

fastapi_oauth2-1.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

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

Hashes for fastapi_oauth2-1.3.0.tar.gz
Algorithm Hash digest
SHA256 8c8135b571af9f882cc94a23afd271107e7a963a966213113a0c0ce0a22ba91c
MD5 dd206dedb0ff65cece04dcdaa63c5edc
BLAKE2b-256 6b0cbc1b22b2f9b8d485d2ca843d7ea53b5cfc86cf9887ed4339445a192c0e8c

See more details on using hashes here.

File details

Details for the file fastapi_oauth2-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_oauth2-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4acdc81ba6e656a340a9b7f8f4e8dccd3974b3df30596d760eb88c1cf721272e
MD5 3fec54de0bf33f5ac18591d7e14a30c6
BLAKE2b-256 d75d0ffec625ac4cb4813af29993d9e187a2238990d6053f66e91beed4dfdefc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page