HTTP Basic Authentication in ASP.NET Core Razor Pages
पिछ्ला सम्बन्धित लेख HTTP Basic Authentication फ्लो ASP.NET Core Razor Pages एप्लीकेशन बनाए जिसका नाम BasicAuthDemo है। प्रोजेक्ट file इस प्रकार है: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> </Project> HTTP Basic Authentication को हैंडल करने के लिए निम्न BasicAuthenticationHandler क्लास file बनाए। ध्यान दीजिए की सरलता के लिए यूजरनाम और पासवर्ड हार्ड कोडेड है। वास्तव में इसे किसी डेटाबेस में रखना चाहिए। using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Options; using System.Net.Http.Headers; using System.Security.Claims; using System.Text; using System.Text.Encodings.Web; namespace BasicAuthDemo { public class BasicAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions> { public B...