anomaly / anomaly/lab-python-server

Reference implementation of OAuth2 + JWT based authentication system

オープン
#52 コメント 0 件 リアクション 0 件 担当者 1 名 @devraj が担当を希望しています GitHub で見る
documentation
主要言語
Python
スター
16
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

**Is your feature request related to a problem? Please describe.**
In light of us dropping the use of various third party middleware for authentication see #25, #33, #34 we should provide a reference implementation of an OAuth2 based password authentication system.

This will make #31 redundant.

The solution will study the

**Describe the solution you'd like**
Study the [OAuth2](https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/) reference implementation outlined by the FastAPI docs and implement a set of handlers that adhere to the proposed standards.

Note that the work being proposed is around authentication and sessions, not sign up and password lifecycle.

The implementation ought to provide context around getting the current user, and possibly an alternative around getting an admin user. We should also look at documenting OAuth2 scopes.

There are two intents of this implementation:
- For use within production applications built using this template
- As a development alternative when the project aims to use systems like AWS Cognito

FastAPI uses `python-jose` for the JWT packages, which has not been updated in a while. `pyJWT` on the other hand is receiving updates, so it will be well worth considering using that.

**Describe alternatives you've considered**
See the issues and projects like #25, #33, #34 [fastapi-jwt-auth](https://indominusbyte.github.io/fastapi-jwt-auth/usage/refresh/)

**Additional context**
Security researchers like @ScottHelme have been writing about the redundancy of CSRF since 2019:
- [Cross-Site Request Forgery is dead!](https://scotthelme.co.uk/csrf-is-really-dead/)
- [CSRF is (really) dead](https://scotthelme.co.uk/csrf-is-really-dead/)

other discussion around Starlettel:
- [Why you may not need a CSRF Middleware in 2022](https://github.com/gnat/csrf-starlette-fastapi#why-you-may-not-need-a-csrf-middleware-in-2022)
- [starlette/1411](https://github.com/encode/starlette/discussions/1411)

> Question to be asked as to why we have not been paying attention to this

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。