Implementing login functionality in asp net core

Veröffentlicht am: 11 Juni 2019
auf dem Kanal: kudvenkat
176,948
1.3k

Implementing login functionality in an asp.net core application using the asp.net core identity API.

Text version of the video
https://csharp-video-tutorials.blogsp...

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
   / @aarvikitchen5572  

Slides
https://csharp-video-tutorials.blogsp...

ASP.NET Core Text Articles & Slides
https://csharp-video-tutorials.blogsp...

ASP.NET Core Tutorial
   • ASP.NET core tutorial for beginners  

Angular, JavaScript, jQuery, Dot Net & SQL Playlists
https://www.youtube.com/user/kudvenka...


To implement the login functionality in an asp.net core application, we need
Login View Model
Login View
A pair of Login action methods in the AccountController - HttpGet login Action and HttpPost login Action

LoginViewModel

To login a user, we need their Email which is the username, password and whether if they want a persistent cookie or session cookie.

public class LoginViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }

[Required]
[DataType(DataType.Password)]
public string Password { get; set; }

[Display(Name = "Remember me")]
public bool RememberMe { get; set; }
}

Session Cookie vs Persistent Cookie

Upon a successful login, a cookie is issued and this cookie is sent with each request to the server. The server uses this cookie to know that the user is already authenticated and logged-in. This cookie can either be a session cookie or a persistent cookie.

A session cookie is created and stored within the session instance of the browser. A session cookie does not contain an expiration date and is permanently deleted when the browser window is closed.

A persistent cookie on the other hand is not deleted when the browser window is closed. It usually has an expiry date and deleted on the date of expiry.

For Login View Code and Login Action Methods code
https://csharp-video-tutorials.blogsp...


Auf dieser Seite können Sie das Online-Video Implementing login functionality in asp net core mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer kudvenkat 11 Juni 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 176,948 Mal angesehen und es wurde von 1.3 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!