Develop Secure Apps with NextJS14, Json Web Token & Cookies
- Description
- Curriculum
- FAQ
- Reviews
In this course you will learn how to secure your NextJS Application with JWT Cookie based Authentication.
Securing a Next.js application with JWT and cookies involves creating a server-side authentication endpoint to handle user logins. Upon successful authentication, the server generates a JSON Web Token (JWT) signed with a secret key. This JWT is then sent to the client as an HTTP-only cookie, enhancing security by preventing JavaScript access.
On the client side, implement functions for user authentication, including login, logout, and status checking. For authenticated requests, include the JWT in the request headers to verify the user’s identity on the server.
In summary, the process entails validating user credentials on the server, generating a signed JWT, and securely transmitting it to the client via an HTTP-only cookie. The client-side implementation manages user authentication functions, and the server verifies requests using the received JWT. This approach enhances application security by utilizing the capabilities of JWTs and secure cookie handling.
JSON Web Tokens (JWT) are a compact, URL-safe means of representing claims between two parties. In web development, JWTs serve as secure tokens for transmitting information, often used for user authentication. Comprising three parts—header, payload, and signature—JWTs are encoded and signed, providing a lightweight and tamper-evident structure. Their versatility and self-contained nature make JWTs widely adopted for transmitting authenticated data, and they are commonly employed in various web-related protocols and frameworks.
-
1Course OverviewVideo lesson
-
2What is JSON WEB TOKEN and how it gets generatedVideo lesson
-
3Different Parts of a JWT tokenVideo lesson
-
4How is the Token used in subsequent request between client and serverVideo lesson
-
5Setting up new Next AppVideo lesson
-
6Designing the home pageVideo lesson
-
7Designing the login Form pageVideo lesson
-
8Installing the required npm dependenciesVideo lesson
-
13Create GET API to get the user profile informationVideo lesson
-
14Creating Layout for DashboardVideo lesson
-
15Making Profile API call and adding logic to restrict routing to dashboardVideo lesson
-
16Fixing the redirect to login page and testing the functionalityVideo lesson
-
17Implementing Logout functionalityVideo lesson
-
18Get the current loggedin user detailsVideo lesson
-
19Resolving the json error and displaying the admin email on dashboardVideo lesson
-
20Testing the complete functionalityVideo lesson
-
21Installing mongoose, creating schema and establishing database connectionVideo lesson
-
22Develop the API for user registration and save user to databaseVideo lesson
-
23Create user registration page and call the API to register the userVideo lesson
-
24Integrating login functionality with databaseVideo lesson
-
25Getting user full name from DB and displaying on dashboardVideo lesson
External Links May Contain Affiliate Links read more