Documentation of my FastAPI learning process. I document what I find necessary.
Posts are listed in the Related post(s) section below. Each entry includes the link to the actual post, the git clone
command for the target code revision, and an excerpt from the post.
git clone -b v0.1.0 https://github.com/behai-nguyen/fastapi_learning.git
FastAPI
provides excellent tutorials that thoroughly introduce the framework. Two sections on security, namely Tutorial - User Guide Security and Advanced User Guide Security, have sparked further questions, which we are discussing in this post. Hopefully, this discussion will lead to a better understanding of how FastAPI
security works.
git clone -b v0.2.0 https://github.com/behai-nguyen/fastapi_learning.git
In the first post, we explore some aspects of OAuth2
authentication, focusing on the /token
path as illustrated in an example from the Simple OAuth2 with Password and Bearer
section of the Tutorial - User Guide Security. In this subsequent post, we implement our own custom preliminary login process, leveraging the /token
path. This means that both the Swagger UI Authorize
button and our application's login button utilise the same server code.
git clone -b v0.3.0 https://github.com/behai-nguyen/fastapi_learning.git
In the second post of our <a href="https://fastapi.tiangolo.com/learn/"title="FastAPI" target="_blank">FastAPI learning series, we implemented a placeholder for the application's own authentication process. In this post, we will complete this process by implementing persistent server-side HTTP sessions using the starsessions library and its Redis store store, as well as extending the OAuth2PasswordBearer class.
MIT license and the GPL license.