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
Hi,
How to implement User Login(Backoffice) programmatically like a Backoffice Login Form ?
Regards.
Hi Van and welcome to Our :-)
We have different services that you can use as you can see here
https://our.umbraco.org/documentation/Reference/Management/Services/
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,
/Dennis
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 ?
Thanks..
Regards, Ivan
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/#");
HttpContext.Current.Response.Redirect("http://localhost:57933/umbraco/#");
i still get umbraco standard login box.
any help is much appreciated!!! thanks
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:
Upload image
Image will be uploaded when post is submitted
Umbraco 7 User Login(backoffice) Programmatically
Hi,
How to implement User Login(Backoffice) programmatically like a Backoffice Login Form ?
Regards.
Hi Van and welcome to Our :-)
We have different services that you can use as you can see here
https://our.umbraco.org/documentation/Reference/Management/Services/
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,
/Dennis
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 ?
Thanks..
Regards, Ivan
I have tried this but no joy...
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!!! thanks
To log in a backoffice user use the PerformLogin method:
Hope this help.
is working on a reply...