Python 3的异步OAuth 2.0框架。
aioauth的Python项目详细描述
Python 3的异步OAuth 2.0框架
aioauth
实现了OAuth 2.0 protocol,可以在异步框架中使用,比如FastAPI / Starlette,aiohttp。它可以在简单的BaseDB接口上使用MongoDB
、PostgreSQL
、MySQL
和gino、sqlalchemy或{a6}等orm。在
为什么这个项目存在?在
对于Python,很少有像oauthlib和authlib这样的优秀OAuth框架,但它们不支持asyncio,将这些库重写为asyncio是一个重大的挑战(请参阅问题here和{a11})。在
支持的RFC
- [x] The OAuth 2.0 Authorization Framework
- [十] OAuth 2.0 Token Introspection
- [十] Proof Key for Code Exchange by OAuth Public Clients
安装
python -m pip install aioauth
FastAPI示例
^{pr2}$设置和默认值
Setting | Default value | Description |
---|---|---|
TOKEN_EXPIRES_IN | 86400 | Access token lifetime. |
AUTHORIZATION_CODE_EXPIRES_IN | 300 | Authorization code lifetime. |
INSECURE_TRANSPORT | False | Allow connections over SSL only. When this option is disabled server will raise "HTTP method is not allowed" error. |
- 项目
标签: