Cast exception w FormsAuthentication

From: news.microsoft.com (phewwee_at_yahoo.com)
Date: 10/16/03


Date: Thu, 16 Oct 2003 14:51:22 -0700

I have a small ASPX app I have created and decided to roll my own Forms
Authentication. Now I take the user name, password and domain and created an
encrypted foms authentication ticket. In the ticket I put some info in the
userdata property. On a different page after authetication I want to accsess
that field. I found a couple of examples, one is like
lblLogin.Text = ((FormsIdentity)User.Identity).Ticket.UserData;

This throws an exception saying cast is not valid. I've looked at this where
the GenericPrincipal is created in the Globalasax file and I can see the
string data in the UserData, does anyone have any idea?



Relevant Pages

  • Re: header("Location: http://name:password@www.mydomain.com")?
    ... you'll have to roll your own authentication ... capital B -- authentication, as I assume you're using, uses the ... their normal browser features. ... Apache documentation's arguments against the browser dialogue box ...
    (alt.php)
  • RE: Programmatic Forms Authentication
    ... management the authentication of the site. ... authorization to a URL programmatically. ... I want the following roll: ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Setting Roles with Forms Authentication and Access 2003
    ... The standard way to do this is to get a list of roles out of your database, ... comma-separated values) in the UserData property of the Forms Authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Forms Authentication UserData
    ... Using forms authentication I want to add several pieces of data to the ... UserData property in the Forms Ticket. ... I am not completely up to date with using ASP.NET's cookies so bare with me. ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast