Mansi Gupta
Steps to achieve Forms Authentication in MVC4
By Mansi Gupta in .NET on May 17 2016
  • Mansi Gupta
    May, 2016 17

    1. Configure the application to use Forms authentication. Modify web.config - 2. Create login page containing fields to be validated - User name, Password.3. Modify configuration settings to redirect unauthenticated users to login page. 4. If the login is successful, create an authentication ticket for the user (encrypted cookie - persistent or non -persistent) FormsAuthentication.SetAuthCookie(model.UserName, false);This will set 1. HttpContext.User.Identity.Name to current logged in user 2. HttpContext.User.Identity.IsAuthenticated to true

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS