Copied to clipboard

Flag this post as spam?

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

  • Mark Arndt Lønquist 20 posts 89 karma points
    Sep 28, 2016 @ 08:34
    Mark Arndt L√łnquist

    Active Directory login works, but menu not loading

    Hello there.

    I've managed to get backoffice logins working with Active Directory. However, upon initial login, the side-menu does not load, and I get some 417 Invalid token errors in the console. 417 Invalid token errors

    If I hit F5 to reload the page, the error goes away, and the side-menu is loaded just fine.

    This is the code:

    var result = Task.FromResult(BackOfficeUserPasswordCheckerResult.InvalidCredentials);
                var pc = new PrincipalContext(ContextType.Domain, WebConfigurationManager.AppSettings["ldapAddress"]);
                var isValid = pc.ValidateCredentials(user.UserName, password);
                if (isValid)
                    result = Task.FromResult(BackOfficeUserPasswordCheckerResult.ValidCredentials);
            catch (Exception ex)
                result = Task.FromResult(BackOfficeUserPasswordCheckerResult.InvalidCredentials);
                LogHelper.Error(typeof(ActiveDirectoryAuthenticator), "Error logging in using ActiveDirectory", ex);
            return result;

    Note: Some code left out (does not affect the issue at hand)

    And this is where I setup the UmbracoCustomOwinStartup:

     public class UmbracoCustomOwinStartup
        public void Configuration(IAppBuilder app)
            var applicationContext = ApplicationContext.Current;
            app.ConfigureUserManagerForUmbracoBackOffice<BackOfficeUserManager, BackOfficeIdentityUser>(
                (options, context) =>
                    var membershipProvider = MembershipProviderExtensions.GetUsersMembershipProvider().AsUmbracoMembershipProvider();
                    var userManager = BackOfficeUserManager.Create(options,
                    userManager.BackOfficeUserPasswordChecker = new ActiveDirectoryAuthenticator();
                    return userManager;

    It seems the cookie being set is not correct, as it changes after I press F5.

    Anyone have an idea?

  • David Peck 662 posts 1777 karma points c-trib
    Sep 28, 2016 @ 11:32
    David Peck

    Hi Mark,

    I don't have an answer, sorry. However I just posted a request for some help on setting this up. Where did you find the info to progress as far as you have? Are you using Azure Active Directory or vanilla AD?

    I'll happily help you troubleshoot this, if I can catch up to where you've got with this.

  • David Peck 662 posts 1777 karma points c-trib
    Sep 28, 2016 @ 12:13
    David Peck

    To answer my question, this is the post I've been looking for:

  • Magic Mike 3 posts 73 karma points
    Nov 20, 2020 @ 12:59
  • David Peck 662 posts 1777 karma points c-trib
    Nov 20, 2020 @ 13:47
Please Sign in or register to post replies

Write your reply to: