Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How to implement User Login(Backoffice) programmatically like a Backoffice Login Form ?
Hi Van and welcome to Our :-)
We have different services that you can use as you can see here
I know that this service is not on the list yet, but we also have a UserService which you can use for Umbraco backoffice users.
Hope this helps,
Hi Dennis, Thanks for reply.
Can you tell me example code, can use this context ? Umbraco.Core.ApplicationContext.Current.Services.UserService
Or should be use this method BackOfficeSignInManager.PasswordSignInAsync ?
I have tried this but no joy...
var result = await signInManager.PasswordSignInAsync(user.UserName, loginModel.Password, isPersistent: true, shouldLockout: false);
this returns true however when i redirect the page to HttpContext.Current.Response.Redirect("http://localhost:57933/umbraco/#");
i still get umbraco standard login box.
any help is much appreciated!!!
To log in a backoffice user use the PerformLogin method:
//Login backoffice user.
//NOTE: PerformLogin method not documented in official doc. Src: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/Security/WebSecurity.cs#L150
var sessionTimeoutInSeconds = UmbracoContext.Security.PerformLogin(userId);
Hope this help.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted