public override Task<bool> CheckPasswordAsync(BackOfficeIdentityUser user, string password)
{
var userService = ApplicationContext.Current.Services.UserService;
try
{
var userStatus = (userService.GetByEmail(user.Email.ToString()) != null) ? true : false;
var userLogin = UmbracoContext.Current.Security.PerformLogin(user.Id);
var user = ApplicationContext.Services.UserService.GetUserById(id);
return Task.FromResult(userStatus);
}
catch (Exception)
{
//throw;
}
return Task.FromResult(false);
}
I am having same issue. userStatus shows true since user exists in database however, performlogin does not happen and return user=null when i check umbTicket status.
if (UmbracoContext.Security.ValidateBackOfficeCredentials(loginModel.Username, loginModel.Password))
{
var httpCtxWrapper = new System.Web.HttpContextWrapper(System.Web.HttpContext.Current);
var umbTicket = httpCtxWrapper.GetUmbracoAuthTicket();
var loginUser = userService.GetByUsername(umbTicket.Name);
}
Umbraco 7 User Login(backoffice) Programmatically
I am having same issue. userStatus shows true since user exists in database however, performlogin does not happen and return user=null when i check umbTicket status.
any idea. thanks
Hi Arthur
Which version of Umbraco are you using? Did you post an issue you Umbraco issue tracker?
Thanks,
Alex
is working on a reply...