Follow by Email

Monday, 10 August 2015

How to login using username only without password in MVC using identity membership

Example:

 public async Task<ActionResult> CustomLogin(string name)
        {
            name = "student@gmail.com";

            var user = await UserManager.FindByNameAsync(name);

            if (user != null)
            {

                await SignInManager.SignInAsync(user, true, true);
            }

            return RedirectToAction("Index", "Student");
        }

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha