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
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.
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:
Any pointers as to what I am doing wrong. This is with Umbraco version 7.4.3 assembly: 1.0.5948.18141
Thanks Stokesy
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
is working on a reply...