Lab Assignment 8 - Sbhavyarao/ASE_Lab8 GitHub Wiki

Objective:

The main objective of this application is to perform JWT authentication.

Pre requisites:

  1. WebStorm IDE
  2. Node
  3. Expressjs
  4. Angular
  5. JWT

Implementation:

  1. Created login and home components.
  2. Configured routing modules in app.routing.modules.ts.
  3. User interface code was written in for login and home pages.

  1. Created login and get details methods in login and home components ts files.

  1. Created backend folder, added code to connect to port 3000.And also added JWT authentication methods.

  1. Saved token details in local storage. Retrieved token details while performing get user details operations.

Sample Output:

  1. By default, Login page will be shown.

  1. After login page when user clicks on login button he/she will be redirected to the home page.

  2. On click of get user details user can see the payload details of JWT token.

  3. Stored token details in local storage.

Conclusion:

  • We analyzed the given source code for this assignment. Installed Json web token. Performed JWT authentication while logging in. We got an idea about JWT authentication.