#basicauthentication #asp.netcore #authentication
This video explains basic authentication in ASP .NET Core Web API
Steps need to be proceed
======================
1, Add UseAuthentication in startup.cs
2, Create Authentication handler
3, implement the handler using AuthenticationHandler with AuthenticationSchemeOptions
4, Add Required namespace
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
using System.Text.Encodings.Web;
5, Get Authorization header using AuthenticationHeaderValue
6, Inject the DB Context to the handler
7, Access the user table validate the credentials if all matched
8, Create Ticket & return the response
Code for create Ticket
==================
var claims = new[] { new Claim(ClaimTypes.Name, _userinfo.Userid) };
var identity = new ClaimsIdentity(claims, Scheme.Name);
var principal = new ClaimsPrincipal(identity);
var ticket = new AuthenticationTicket(principal, Scheme.Name);
Url for Encoding
===============
https://www.base64encode.org/
In questa pagina del sito puoi guardare il video online ASP .NET Core Web API - Basic Authentication + Entity Framework in Tamil || nihira techiees della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Nihira Techiees 06 gennaio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 3,889 volte e gli è piaciuto 57 spettatori. Buona visione!