Storing extended value in HttpContext.Current.User (IPrinciple)
I created a class ExtendedId
that extends GenericIdentity
. (ID and name are stored here)
In the httpmodule, I have stored this extended id in Current.User, for example:
HttpContext.Current.User = new GenericPrincipal(myExtendedId, roles);
The problem is, how can I get my type again ExtendedId
?
If I try this:
ExtendedId eId = (ExtendedId)HttpContext.Current.User.Identity;
I am getting casting error. I have a feeling that I am doing something silly here with the casting, but this morning I am a little hazy.
+2
a source to share
2 answers