Re: (CustomIdentity)Thread.CurrentPrincipal.Identity - Cast not Valid

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 09/19/05


Date: Mon, 19 Sep 2005 10:13:23 -0700

Hello John,

you have to set the identity on every request. Gimme more info,
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> I have created CustomPrincipal and CustomIdentity classes. Everything
> works great on my WinForms application, but as soon as i run my
> ASP.NET client I get a System.InvalidCastException: Specified cast is
> not valid error on the following line.
>
> CustomIdentity id = (CustomIdentity)Thread.CurrentPrincipal.Identity;
>
> The same exact code works in WinForms.
>
> Help !
>
> Thanks.
>
> John
>