Copied to clipboard

Flag this post as spam?

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


  • Peter Stokes 5 posts 25 karma points
    May 22, 2016 @ 06:38
    Peter Stokes
    0

    Custom Membership Provider Issues

    Hi,

    I have implemented a custom membership and role provider. These work fine and I can login and access restricted pages base on roles.

    Two big problems though ..

    1) If I use the login status macro or to be more precise any call to Members.GetCurrentLoginStatus(); either causes a logout or removes the cookie. Members.IsLoggedIn() works fine.

    2) I get a null reference error on logout (not a logout from above) as follows:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Web.Security.MembershipHelper.IsMemberAuthorized(Boolean allowAll, IEnumerable`1 allowTypes, IEnumerable`1 allowGroups, IEnumerable`1 allowMembers) +155
       Umbraco.Web.Security.WebSecurity.IsMemberAuthorized(Boolean allowAll, IEnumerable`1 allowTypes, IEnumerable`1 allowGroups, IEnumerable`1 allowMembers) +139
       Umbraco.Web.Mvc.MemberAuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +383
       System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +181
       System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
    

    Any pointers as to what I am doing wrong. This is with Umbraco version 7.4.3 assembly: 1.0.5948.18141

    Thanks Stokesy

  • Doogie Talons 183 posts 318 karma points
    Jun 09, 2016 @ 07:45
    Doogie Talons
    0

    For anyone still interested or following this thread (Sorry for the dupe) I found the problem and it wasn't where I expected.

    Pre live we put the site into Anonymous Authentication Disabled : Windows Authentication Enabled

    Weird that we could still login to umbraco as a user once logged in via the NT password. But for some reason it messed about with the Members module. It also wrote the line Authentication Windows in the web config.

    So whilst trouble shooting we changed the web config back to Forms and set the authentication modes in IIS to how it will be when live and everything works.

    Cheers

    Doogie

    Doogie

Please Sign in or register to post replies

Write your reply to:

Draft