Custom IIdentity object casting

R

Random

I've seen this topic around a bit, but no solution offered to the problem.
I have a custom class that implements IIdentity with additional properties,
some of which are essential to the authorization process. On login, I can
create and set the user based on the login, but when a subsequent page
request is made, the User.Identity is back to the standard. Now, logic
dictates that I could simply cast that instance of Identity back into my
custom class, but it doesn't work.

To me, this seems buggy. I would think that when asp.net reloads the
Principal and the Identity, that they would do so with the same class type
that they were first created under, based on them having the interface, but
that doesn't work. Even if the <authentication> node in web.config had
"principalType" and "identityType" attributes....

Can this be set somewhere? Or handled in a different way that doesn't rely
on going outside this process?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top