Click here to Skip to main content
15,887,966 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have been reading different articles of Microsoft to find out the best way to authenticate users before login into my application. However, my purpose is not met by those articles so I landed up here.

My Requirement:
I have a database of users that maintain user details like -Email, UserName, Password, Active status and so on when he registers. On registering, email will be send to admin of the system and when admin makes that user active, then only user will be able to logon.

Also, if user tries to access pages that is not authorized to be seen without logins, he should be redirected to login page.

What is the best practices to fulfill me need???

What I have tried:

Security, Authentication, and Authorization with ASP.NET MVC | Microsoft Docs[^]

Tried this link but for now I do not need any of the confirmation techniques stated here.
Posted
Updated 13-Mar-19 2:58am

1 solution

What's wrong with one of the links you already posted?

Create a secure ASP.NET MVC 5 web app with log in, email confirmation and password reset (C#) | Microsoft Docs[^]

If it doesn't do what you want exactly then amend it so that it does.
 
Share this answer
 
Comments
Codes DeCodes 13-Mar-19 11:41am    
This link only tells about authentication for the first time. What I am looking for is that piece of code for authenticating user every time he logs in using tables from database.
F-ES Sitecore 13-Mar-19 12:49pm    
In the Login action on the AccountController simply lock the users account and re-send the auth email.
Codes DeCodes 13-Mar-19 12:54pm    
Somewhere I found formsauthenticaion class and now I am using that..
Anyways, thanks...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900