Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Van Helsing 2 posts 72 karma points
    Apr 11, 2016 @ 12:41
    Van Helsing

    Umbraco 7 User Login(backoffice) Programmatically


    How to implement User Login(Backoffice) programmatically like a Backoffice Login Form ?


  • Dennis Aaen 4448 posts 17912 karma points admin hq c-trib
    Apr 11, 2016 @ 12:56
    Dennis Aaen

    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,


  • Van Helsing 2 posts 72 karma points
    Apr 13, 2016 @ 07:07
    Van Helsing

    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 ?


    Regards, Ivan

  • Arthur 10 posts 80 karma points
    Sep 07, 2018 @ 11:01

    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!!! thanks

  • Christian Tricarico 8 posts 88 karma points
    Oct 01, 2018 @ 14:14
    Christian Tricarico

    To log in a backoffice user use the PerformLogin method:

    //Login backoffice user.
    //NOTE: PerformLogin method not documented in official doc. Src:
    var sessionTimeoutInSeconds = UmbracoContext.Security.PerformLogin(userId);

    Hope this help.

Please Sign in or register to post replies

Write your reply to: