Copied to clipboard

Flag this post as spam?

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


  • Kristoffer Eriksen 185 posts 465 karma points
    Jan 12, 2023 @ 08:42
    Kristoffer Eriksen
    0

    Equivalent function "PerfomLogin" in Umbraco10

    Hey fellow Umbracopeople

    Is there an equivalent method in Umbraco 10 to the Umbraco 8

    var ws = new WebSecurity(HttpContext, ApplicationContext);
    var user = Services.UserService.GetByUsername("username");
    ws.PerformLogin(user.Id);
    

    Simple Backenduser signin.

    /Kristoffer

  • Kristoffer Eriksen 185 posts 465 karma points
    Jan 12, 2023 @ 08:47
    Kristoffer Eriksen
    0

    After several hours of searching and finally giving up, and then creating this post, I stumbled upon https://our.umbraco.com/forum/using-umbraco-and-getting-started/110359-active-directory-backoffice-users-in-umbraco-10

    I will have a look at that ;-)

  • Kristoffer Eriksen 185 posts 465 karma points
    Jan 12, 2023 @ 11:35
    Kristoffer Eriksen
    100

    Well ... Once I got the correct code, it was easy :-)

    This does it:

    BackOfficeIdentityUser backofficeUser = await _backofficeUserManager.FindByNameAsync(username);
    await _backofficeSigninManager.SignInAsync(backofficeUser, false);
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies