Skip to main content

Posts

Part-2 Adding New User Into Database And Generating Custom JWT Token - (Blazor WebAssembly Standalone App Google Authentication)

Part-1  implemented sample to work with Google authentication into a Blazor WebAssembly standalone application. Now in this article, we will create user records into our database on users authenticated into our application using a Google account. Also, create a custom JWT for our secured endpoint. Because token given by google for our blazor web assembly application can't be used against our own secured endpoint. So while saving the user record into our database we will also generate the JWT token. Configure Email Scope: By default, the Blazor WebAssembly template requests scope like 'openid', 'profile'. Now we have to add one more additional scope like 'email'. If you observe after login with a google account, the user email is not sent by google as a claim to our blazor application. So to add user record we should have the email address, so for that let's add a new scope like 'email', which will give us user email address as one of the claim

Part-1 Blazor WebAssembly Standalone Application User Login Using Google Account

In this article, we will implement google authentication for the Blazor WebAssembly Standalone application. The Standalone app defines we directly implement authentication on Blazor WebAssembly without using dependent API for authentication. This Google authentication will be 3 parts series: Part-1(Current article) Create a Blazor WebAssembly application with individual authentication enabled and then configure with google authentication. Part-2 Register the users into our application database who log in to our application using a google account. Also, generate JWT authentication to consume secured API. Part-3 (Totally Optional article) Integrate google authentication into the existing Blazor WebAssembly application(an application that is created without enabling individual authentication). Create A Blazor WebAssembly App With Authentication: Let's begin our demo by creating the Blazor Web Assembly application by enabling the individual authentication option while selecting the

A Blazor WebAssembly CRUD Sample Using MudBlazor Components

In this article, using the MudBlazor UI component we will implement a CRUD sample in Blazor WebAssembly. Create A Blazor WebAssembly Sample Application: To accomplish our goal let's create a sample Blazor WebAssembly application. Install MudBlazor Package: Package Manager: Install-Package MudBlazor -Version 5.0.7 .Net CLI dotnet add package MudBlazor --version 5.0.7 MudBlazor Setup: Add Mudblazor namespace into the '_Imports.razor' _Imports.razor: @using MudBlazor Add the below CSS files inside of the head tag in 'index.html'. wwwroot/index.html: <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" /> <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" /> Remove the CSS files like 'bootstrap.min.css' and '{your_applicationname}.style.css'. Add MudBlazor javascript file in 'index.html' just above the closing bod

A Small Guide On NestJS Queues

NestJS Application Queues helps to deal with application scaling and performance challenges. When To Use Queues?: API request that mostly involves in time taking operations like CPU bound operation, doing them synchronously which will result in thread blocking. So to avoid these issues, it is an appropriate way to make the CPU-bound operation separate background job.  In nestjs one of the best solutions for these kinds of tasks is to implement the Queues. For queueing mechanism in the nestjs application most recommended library is '@nestjs/bull'(Bull is nodejs queue library). The 'Bull' depends on Redis cache for data storage like a job. So in this queueing technique, we will create services like 'Producer' and 'Consumer'. The 'Producer' is used to push our jobs into the Redis stores. The consumer will read those jobs(eg: CPU Bound Operations) and process them. So by using this queues technique user requests processed very fastly because actually