Storing extended IIdentity in HttpContext.Current.User (IPrinciple)
- by UpTheCreek
I have created an ExtendedId class which extends GenericIdentity. (This stores Id as well as name)
In a httpmodule I stored this extended id in Current.User like so:
HttpContext.Current.User = new GenericPrincipal(myExtendedId, roles);
Problem is, later, how do I get at my ExtendedId type again?
If I try this:
ExtendedId eId = (ExtendedId)HttpContext.Current.User.Identity;
I get a casting error. I have a feeling I'm doing something stupid here with casting, but I'm a bit foggy this morning.