Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET MVC 6 Simple Authentication without database

I've created a simple website in ASP.NET 5 MVC 6.

I have 1 controller with 1 index-method and view.

I need authentication on this with [Authorize]

I have a login-form on a view with an input taking a number. Users can log in if they can answer the right number to a calculation.. I need to check the answer in C#-code.

So basically i want a AuthenticationController with a Login(int answer) where i can check the result and redirect to the index-page. If they try to acces the index-page not logged in, they must be redirected to the login page :)

Possible in a simple way?

like image 671
capcapdk Avatar asked Apr 17 '26 07:04

capcapdk


1 Answers

Read this Using Cookie Middleware without ASP.NET Core Identity

like image 174
Ali Avatar answered Apr 18 '26 23:04

Ali



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!