Extending Principal and Identity object
-
I want to extend these object, but keeping the functionnality of WindowsPrincipal and WindowsIdentity. I believe it's not that simple ? Sébastien Lachance - My Blog
-
I want to extend these object, but keeping the functionnality of WindowsPrincipal and WindowsIdentity. I believe it's not that simple ? Sébastien Lachance - My Blog
If they aren't sealed then it shouldn't be that difficult. Just derive classes from windowsidentity and windowsPrincipal. On the Application_Authenticated event. Construct a new identity and principal of your type from the existing windows objects and then replace both Thread.CurrentPrincipal and HttpContext.User and you should be good to go. If they are sealed, then just encapsulate them instead of derive from them.
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon