reading-notes

Authentication & Production Server

JSON Web Tokens

What is JSON Web Token?

When should you use JSON Web Tokens?

Here are some scenarios where JSON Web Tokens are useful:

What is the JSON Web Token structure?

In its compact form, JSON Web Tokens consist of three parts separated by dots (.), which are:

Therefore, a JWT typically looks like the following: xxxxx.yyyyy.zzzzz

Payload

Signature

Putting all together

Putting it all together

How do JSON Web Tokens work?

Web Tokens

  1. The application or client requests authorization to the authorization server. This is performed through one of the different authorization flows. For example, a typical OpenID Connect compliant web application will go through the /oauth/authorize endpoint using the authorization code flow.
  2. When the authorization is granted, the authorization server returns an access token to the application.
  3. The application uses the access token to access a protected resource (like an API).

Source: https://jwt.io/introduction/


How to Use JWT Authentication with Django REST Framework

Installation & Setup

Obtain Token

Obtain Token

Access Token

Timeout Token

Refresh Token

Refresh Token

Source: https://simpleisbetterthancomplex.com/tutorial/2018/12/19/how-to-use-jwt-authentication-with-django-rest-framework.html


Django Runserver Is Not Your Production Server

Source: https://vsupalov.com/django-runserver-in-production/


Things I Want To Know More About