# fastapi-oauth2 <img src="https://github.com/pysnippet.png" align="right" height="64" />
[](https://pypi.org/project/fastapi-oauth2/)
[](https://playground.pysnippet.org/fastapi-oauth2/)
[](https://pypi.org/project/fastapi-oauth2/)
[](https://pypi.org/project/fastapi-oauth2/)
[](https://github.com/pysnippet/fastapi-oauth2/actions/workflows/tests.yml)
[](https://github.com/pysnippet/fastapi-oauth2/actions/workflows/docs.yml)
FastAPI OAuth2 is a middleware-based social authentication mechanism supporting several OAuth2 providers. It leverages
the [social-core](https://github.com/python-social-auth/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](https://docs.pysnippet.org/fastapi-oauth2/integration/configuration)
should be added to the application.
```python
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](https://github.com/pysnippet/fastapi-oauth2/blob/master/LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "fastapi-oauth2",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "python, sso, auth, login, oauth, oauth2, social, fastapi, allauth, security, middleware, authentication",
"author": "Artyom Vancyan",
"author_email": "artyom@pysnippet.org",
"download_url": "https://files.pythonhosted.org/packages/6b/0c/bc1b22b2f9b8d485d2ca843d7ea53b5cfc86cf9887ed4339445a192c0e8c/fastapi_oauth2-1.3.0.tar.gz",
"platform": "unix",
"description": "# fastapi-oauth2 <img src=\"https://github.com/pysnippet.png\" align=\"right\" height=\"64\" />\n\n[](https://pypi.org/project/fastapi-oauth2/)\n[](https://playground.pysnippet.org/fastapi-oauth2/)\n[](https://pypi.org/project/fastapi-oauth2/)\n[](https://pypi.org/project/fastapi-oauth2/)\n[](https://github.com/pysnippet/fastapi-oauth2/actions/workflows/tests.yml)\n[](https://github.com/pysnippet/fastapi-oauth2/actions/workflows/docs.yml)\n\nFastAPI OAuth2 is a middleware-based social authentication mechanism supporting several OAuth2 providers. It leverages\nthe [social-core](https://github.com/python-social-auth/social-core) authentication backends and integrates seamlessly\nwith FastAPI applications.\n\n## Integration\n\nFor integrating the package into an existing FastAPI application, the router with OAuth2 routes and\nthe `OAuth2Middleware` with particular [configs](https://docs.pysnippet.org/fastapi-oauth2/integration/configuration)\nshould be added to the application.\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_oauth2.middleware import OAuth2Middleware\nfrom fastapi_oauth2.router import router as oauth2_router\n\napp = FastAPI()\napp.include_router(oauth2_router)\napp.add_middleware(OAuth2Middleware, config=OAuth2Config(...))\n```\n\n## Contribute\n\nAny contribution is welcome. Always feel free to open an issue or a discussion if you have any questions not covered by\nthe documentation. If you have any ideas or suggestions, please, open a pull request. Your name will shine in our\ncontributors' list. Be proud of what you build!\n\n## License\n\nCopyright (C) 2023 Artyom Vancyan. [MIT](https://github.com/pysnippet/fastapi-oauth2/blob/master/LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Easy to integrate OAuth2 authentication with support for several identity providers.",
"version": "1.3.0",
"project_urls": {
"Documentation": "https://docs.pysnippet.org/fastapi-oauth2/",
"Source Code": "https://github.com/pysnippet/fastapi-oauth2/"
},
"split_keywords": [
"python",
" sso",
" auth",
" login",
" oauth",
" oauth2",
" social",
" fastapi",
" allauth",
" security",
" middleware",
" authentication"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d75d0ffec625ac4cb4813af29993d9e187a2238990d6053f66e91beed4dfdefc",
"md5": "3fec54de0bf33f5ac18591d7e14a30c6",
"sha256": "4acdc81ba6e656a340a9b7f8f4e8dccd3974b3df30596d760eb88c1cf721272e"
},
"downloads": -1,
"filename": "fastapi_oauth2-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3fec54de0bf33f5ac18591d7e14a30c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10770,
"upload_time": "2024-09-30T18:26:43",
"upload_time_iso_8601": "2024-09-30T18:26:43.468240Z",
"url": "https://files.pythonhosted.org/packages/d7/5d/0ffec625ac4cb4813af29993d9e187a2238990d6053f66e91beed4dfdefc/fastapi_oauth2-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6b0cbc1b22b2f9b8d485d2ca843d7ea53b5cfc86cf9887ed4339445a192c0e8c",
"md5": "dd206dedb0ff65cece04dcdaa63c5edc",
"sha256": "8c8135b571af9f882cc94a23afd271107e7a963a966213113a0c0ce0a22ba91c"
},
"downloads": -1,
"filename": "fastapi_oauth2-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "dd206dedb0ff65cece04dcdaa63c5edc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 13235,
"upload_time": "2024-09-30T18:26:44",
"upload_time_iso_8601": "2024-09-30T18:26:44.791013Z",
"url": "https://files.pythonhosted.org/packages/6b/0c/bc1b22b2f9b8d485d2ca843d7ea53b5cfc86cf9887ed4339445a192c0e8c/fastapi_oauth2-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-30 18:26:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pysnippet",
"github_project": "fastapi-oauth2",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "fastapi-oauth2"
}