/// <summary> /// Logins the specified user name. /// </summary> /// <param name="userName">Name of the user.</param> /// <param name="password">The password.</param> /// <returns></returns> public bool Login(string userName, string password) { if (String.IsNullOrEmpty(userName) || String.IsNullOrEmpty(password)) { return(false); } //Put the validation Logic call the web api if (!(userName == "kparekh" && password == "test")) { return(false); } //First SignOut from the current user if already logged in FormsAuthenticationHelper.Logout(); FFGPrincipalSerializationModel userData = new FFGPrincipalSerializationModel() { DisplayName = userName, Roles = new List <string>() { "User" }, Id = new Guid() }; FormsAuthenticationHelper.CreateAuthTicket(userName, userData); return(true); }