Skip to main content

Posts

Part-4 |Blazor WebAssembly[.NET 7] JWT Authentication Series | Implement Refresh Token & User Logout

The main objectives  of this article are: Implement Refresh Token User Logout Refresh Token: When the JWT access token expires to renew it without user credentials we will use the Refresh Token. The user sends a valid 'User Name' and 'Password' to the server, then the server will generate JWT Access Token and Refresh Token sent as a response. The JWT Access Token is a short-lived token(eg: 20 minutes) and Refresh Token is a long live token(eg: 7 days). Now client application sends a JWT access token in the request header that makes the user authenticated. If the JWT token expires then the server returns a 401 authorized response. Then the client sends the refresh token to the server to regenerate the JWT Access Token. The server validates the refresh token and returns a new JWT Access Token and a new Refresh Token as a response. SQL Script To Create UserRefreshToken Table: Let's run the below sql script to create 'UserRefreshToken' table that contains colum

Angular(16) CRUD Example | Search | Sorting | Pagination

In this article, we will implement an Angular(16) CRUD sample. Angular: Angular is a front-end framework that can be used to build a single-page application. Angular applications are built with components that make our code simple and clean. Angular components compose of 3 files like TypeScript(*.ts), HTML File(*.html), CSS File(*.css) Components typescript file and HTML file support 2-way binding which means data flow is bi-directional. The component typescript file listens for all HTML events from the HTML file. Create Angular(16) Application: Let's create the angular(16) application to accomplish our demo. Now install the angular CLI command on our local machine. If your system already installed angular CLI to get the latest angular application just run the following command again so that angular CLI gets updated. npm install -g @angular/cli Run the below command to create an angular application. ng new project_name While creating the app CLI requires few inputs from us