Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a C# Login handler

How would I go about creating a web app login handler in C#?

In Java I would use a JSP that posts the username and password to a servlet, which then delegates to a POJO - for the db lookup and validation. If validation fails the servlet forwards onto the login.jsp for another attempt, if successfull then forwards to the secure resource.

like image 951
Deano Avatar asked Aug 15 '26 10:08

Deano


2 Answers

Look into Forms Authentication.

like image 154
Jason Bunting Avatar answered Aug 17 '26 00:08

Jason Bunting


Mainly, it's a terminology issue. Let me translate your Java to ASP.NET MVC:

In ASP.NET MVC, I would use an HTML view that posts the username and password to a Controller action, which then delegates to a POCO - for the db lookup and validation. If validation fails the Controller renders the Login view for another attempt, if successful then forwards to the secure resource.

And, to WebForms:

In ASP.NET WebForms, I would use a LoginControl that postbacks the username and password back to the Login.aspx codebehind, which then delegates to a POCO - for the db lookup and validation. If validation fails the Login.aspx page would be shown again for another attempt, if successful then redirects to the secure resource.

like image 24
Mark Brackett Avatar answered Aug 17 '26 00:08

Mark Brackett



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!