Using Application_AuthenticateRequest to set custom principal for Members
Hi,
I've written a custom membership provider (basically it just inherits the standard provider and stores some extra stuff in the UserData of the FormsAuthentication ticket), that all works fine, but I'd like to be able to set a custom principal in the Application_AuthenticateRequest event.
I've managed to wire into the event happily, however, I've hit a snag. The event is fired for both Members, and back office Users. How do I tell if the current user is a member or user? I presume there must be a way of telling this, as otherwise users would be able to log into the back office and vice versa.......
So my question is, how do I tell the difference in my code? They both fire the event, but I can't find an obvious way to tell the two types of user apart.
Using Application_AuthenticateRequest to set custom principal for Members
Hi,
I've written a custom membership provider (basically it just inherits the standard provider and stores some extra stuff in the UserData of the FormsAuthentication ticket), that all works fine, but I'd like to be able to set a custom principal in the Application_AuthenticateRequest event.
I've managed to wire into the event happily, however, I've hit a snag. The event is fired for both Members, and back office Users. How do I tell if the current user is a member or user? I presume there must be a way of telling this, as otherwise users would be able to log into the back office and vice versa.......
So my question is, how do I tell the difference in my code? They both fire the event, but I can't find an obvious way to tell the two types of user apart.
Any help greatly appreciated!
One could use URL to determine if it umbraco backend:
p.s. Use Init to register Application_AuthenticateRequest event handler:
is working on a reply...