Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adupuis@dublin.ie - 31 Aug 2007 12:52 GMT
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
Alex Meleta - 31 Aug 2007 13:30 GMT
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'
adupuis@dublin.ie - 31 Aug 2007 13:51 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>
> > 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.