Copied to clipboard

Flag this post as spam?

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


  • Matt 7 posts 27 karma points
    Sep 07, 2014 @ 13:27
    Matt
    0

    Active Directory for Members

    Hi,

    Sorry to raise the subject of AD with regards to Members again, but this one is really starting to cause me problems.

    A little while back, I wrote a specialised class, inheriting from ActiveDirectoryMembershipProvider as well as a custom Role provider class, inheriting from RoleProvider.

    After a lot of debugging and tracing through the Umbraco source, I got them both working great with both the back office as well as with front end membership authentication.

    Whilst the RoleProvider need quite a bit of cust code, the MembershipProvider actually only needed an override on the GetUser method to parse the domain prefix etc. - as shown below.

    public override MembershipUser GetUser(string username, bool userIsOnline) { string domainUser = Regex.Replace(username, ".\\(.)", "$1", RegexOptions.None); return base.GetUser(domainUser, userIsOnline);

        }
    

    I've recently upgraded our instance of Umbraco to the latest - 7.1.6, only to find that the MembershipProvider is broken again. I realise that quite a bit of work was done on the providers between the version that worked 7.0.4 and the latest 7.1.6.

    Would someone be able to tell me please, what changes I may need to make to get this to work again?

    The YSOD error I'm getting in the umbraco backoffice when I click on the Members application is show below.

    Failing that, any suggestions on how to identify which logic is failing by identifying the logic that loads the tree would be most appreciated. I've managed to trace it some way through to the TryGetRootNode method, but couldn't find where the logic to actually get the tree nodes was located.

    Many thanks in advance, Matt

    --ERROR STACK TRACE--

    Failed to retrieve data for application tree member Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Stack Trace:

    at Umbraco.Web.Trees.ApplicationTreeExtensions.

Please Sign in or register to post replies

Write your reply to:

Draft