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?
Read this Using Cookie Middleware without ASP.NET Core Identity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With