narancs's blog

JWT authentication with Django and React


Welcome to a series on JWT authentication with Django backend and React frontend! In this series, we’ll delve deep into the realm of secure user authentication and authorization, leveraging the power of JWT tokens. Below is a brief overview of what you can expect from each post in the series.

  1. Setting up Django project with custom User model. In this part, we are going to setup a Django project in a virtual environment. We will configure PostgreSQL database instead of the default SQLite. Then we are going to create a custom User model to use email address for login instead of username.
  2. Creating token obtain and token refresh APIs. We will configure Django to use JWT authentication using Rest Framework’s Simple JWT package. Then we will setup the Token obtain and Token refresh APIs.
  3. (Coming soon) Creating user registration API with email verification. We are going to create the user registration API. Then we will setup an email verification API as well, so once a user is registered, the email still has to be verified before the user can login (obtain tokens).
  4. (Coming soon) React pages for user registration, and login. In this part, we are going to setup our React front-end to use the Django APIs for user registration, email verification and login.

Once I am finished with the basic parts mentioned above, I am planning to extend the series by adding extra features. Some of my ideas at the moment:

  • Two-factor authentication
  • Social media authentication
  • Login with SAML identity provider

Table of Contents

Notify of
Inline Feedbacks
View all comments

Related posts

Would love your thoughts, please comment.x