Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Unable to cast object of type 'System.Security.Principal.GenericIdentity' to type 'System.Web.Security.FormsIdentity'.

Reply
Thread Tools

Unable to cast object of type 'System.Security.Principal.GenericIdentity' to type 'System.Web.Security.FormsIdentity'.

 
 
adupuis@dublin.ie
Guest
Posts: n/a
 
      08-31-2007
Hello, I'm currently working on a web application that normally works
fine. Times to times I have the following error:
'
Unable to cast object of type
'System.Security.Principal.GenericIdentity' to type
'System.Web.Security.FormsIdentity'.
'

Have you an idea where it could come from ?
I think it's linked to the line:

Private formId As FormsIdentity = User.Identity

My web.config has the line:
<authentication mode="Forms"/>


Regards

 
Reply With Quote
 
 
 
 
Alex Meleta
Guest
Posts: n/a
 
      08-31-2007
Hi,

Same interfaces does not mean parentness. System.Web.Security.FormsIdentity
doesn't direved from System.Security.Principal.GenericIdentity.

You can use only casting to common interface IIdentity in this case

Regards, Alex
[TechBlog] http://devkids.blogspot.com



> FormsIdentity'
>



 
Reply With Quote
 
 
 
 
adupuis@dublin.ie
Guest
Posts: n/a
 
      08-31-2007
On Aug 31, 1:30 pm, Alex Meleta <(E-Mail Removed)> wrote:
> Hi,
>
> Same interfaces does not mean parentness. System.Web.Security.FormsIdentity
> doesn't direved from System.Security.Principal.GenericIdentity.
>
> You can use only casting to common interface IIdentity in this case
>
> Regards, Alex
> [TechBlog]http://devkids.blogspot.com
>
> > FormsIdentity'


The object should be of the System.Web.Security.FormsIdentity type,
it appeared that I wasn't authenticated, simply.

What I find weird is that the same problem occured to an user of the
website
on a page that was secured by the web.config:
<authorization>
<allow users="Jean, Jane, Mark"/>
</authorization>


Many thanks,
Alex

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to cast object of type 'System.Byte[]' to type 'System.String'. Imran Aziz ASP .Net 4 01-19-2011 03:39 AM
Unable to cast object of type 'ASP.main_master' to type 'ASP.main_master'. craigkenisston@hotmail.com ASP .Net 2 08-15-2006 11:23 PM
Unable to cast object of type 'asp.usercontrols_....._ascx' to type 'usercontrols_.....' marshausk@hotmail.com ASP .Net 1 08-14-2006 12:41 PM
Help: Unable to cast object of type 'System.Int32' to type 'System.String'. keithb ASP .Net 3 05-07-2006 08:06 AM
Unable to cast object of type 'ASP.' to type '' hlyall1189@gmail.com ASP .Net 0 04-11-2006 08:01 PM



Advertisments