Create Self-Signed Certificate

Open PowerShell as administrator Run the following command: C:\Users\user01> New-SelfSignedCertificate -Subject “CN=OrgCert1234” -CertStoreLocation “cert:\LocalMachine\My” Now, what we have to do is obtain the private key certificate file to be able to upload it to Azure: Press the windows key Type Manage Computer Certificates and press Enter Go to Personal (on the left), then Certificates Double-click on the... » read more

Deployment error from new Development Computer- HTTP Error 500.30 – ASP.NET Core app failed to start due to certificate authentication issue

Issue: Getting the following error message after deploying a Blazor web app from a new development computer Resolution: Update “Self Signed Certificate” to Blazor web app and web app server config. Need to create a new self signed certificate on development computer, upload to Azure web app. Then update the self signed certificate section of... » read more

Setup Account confirmation and password recovery in ASP.NET Core

Setup SendGrid Account Setup account at https://sendgrid.com/ Get API key. NuGet and install SendGrid to app. Blazor WebAssembly Setup Note: Add to “Server” project, not “Client” project. Need to setup user secrete for the application first. Add “SendGridUser” and “SendGridKey” user secrete to Server project. secrets.json Add classes to Services folder AuthMessageSenderOptions.cs EmailSender.cs Areas.Identity.Pages.Account.RegisterConfirmation page... » read more

Setting up Certificate for IdentityServer4 in Azure App Service

Error: Publishing a new Blazor app with Identity to Azure App Service giving the following error: HTTP ERROR 500 Fix: Steps: Windows PowerShell (Admin mode) Manage computer certificates Certificates – Local Computer -> Personal -> Certificates Right click on certificate -> Export Enable Password and select “TripleDES-SHA1” Upload pfx file to Azure App Service Get... » read more

AuthenticationStateProvider vs AuthenticationState

AuthenticationStateProvider AuthenticationState AuthenticationStateProvider vs AuthenticationState Blazor has a built-in service called AuthenticationStateProvider service. This service obtains authentication state data from ASP.NET Core’s HttpContext.User. This is how authentication state integrates with existing ASP.NET Core authentication mechanisms. It is this service that is used by AuthorizeView component and CascadingAuthenticationState component to get the authentication state. Don’t use AuthenticationStateProvider directly. Use the AuthorizeView component. The main drawback to using AuthenticationStateProvider directly... » read more

Custom Identity Claim in Blazor

1. Create new field of string type in the AspNetUsers table of Identity database. 2. Add field to ApplicationUser class. (Server) 3. Create new class called CustomUserClaimsPrincipalFactory 4. Add to ConfigureServices in Startup.cs (Server) Note: As soon as the line .AddClaimsPrincipalFactory<CustomUserClaimsPrincipalFactory>(); is added, role does not work anymore.