anomaly / anomaly/lab-python-server

Reference implementation of OAuth2 + JWT based authentication system

Đang mở
#52 0 bình luận 0 reaction 1 người được giao Được @devraj nhận Xem trên GitHub
documentation
Ngôn ngữ chính
Python
Star
16
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.