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.4.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file fastapi_oauth2-1.4.0.tar.gz.

File metadata

  • Download URL: fastapi_oauth2-1.4.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fastapi_oauth2-1.4.0.tar.gz
Algorithm Hash digest
SHA256 29938ebe17ef8ce5f047ab74be3bcdb78314a7525350ec2dd7cd01f132d0ec5a
MD5 b9b70bc98cc302caf50c0c113dc3b0d2
BLAKE2b-256 2fb0b176e52bbf4a139c6bac6684aef375031dad86d3df52579afdbeb940c8c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_oauth2-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fastapi_oauth2-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d6adda6fa857b1b32f1528214a47ec9c8a2fe7e4e67888388a6d44566c41731
MD5 6fde35e3bc5be8e4bba831575c6d4ed2
BLAKE2b-256 454686d4fe757bb3828b4069cd5ecb0d2c115b2929a2ba3fcd44d30df16da4e8

See more details on using hashes here.

Supported by

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