1
Reply

Steps to achieve Forms Authentication in MVC4

Mansi Gupta

Mansi Gupta

May 17, 2016
171
0

    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

    Mansi Gupta
    May 17, 2016
    0