[HttpPost]
public ActionResult Login(UserVM userVM)
{
if (ModelState.IsValid || userVM.CheckWindowsAuth)
{
_userLF.UserName = userVM.UserName;
_userLF.Password = userVM.Password;
if (_userLF.AuthenticateUser(_userLF, userVM.CheckWindowsAuth))
{
}
The above line takes my user name and password for authentication and returns true or false.
I have added Authorize attribute to all other controller like below:
[Authorize]
public class ClaimsController : Controller
{}
When my below line in my Login method confirms that user is authenticated successfully by returning true, I want [Authorize] to be overridden in other controller.
if (_userLF.AuthenticateUser(_userLF, userVM.CheckWindowsAuth))
{
}
For example the controller below even when user authentication returns true, but because I have given Authorize attribute to Home controller the control does not enter the Home Controller. I want Authorize attribute to know that user is already authenticated and let request successfully map to my action in this controller (so I can open Home page):
[Authorize]
public class ClaimsController : Controller
{
}