newbie seeks User.Identity and Application_AuthenticateRequest help

From: Mad Scientist Jr (usenet_daughter_at_yahoo.com)
Date: 05/27/04


Date: 27 May 2004 11:22:53 -0700

I'm trying to understand how security works in a ASP.NET c# project.
The global.asax has this code:

protected void Application_AuthenticateRequest(Object sender,EventArgs e)
{
HttpCookie rolesCookie = Request.Cookies["roles"];
if ((!(rolesCookie==null)) && (!(Context.User==null)))
        {
        GenericIdentity gi = new GenericIdentity(User.Identity.Name);
        GenericPrincipal gp = new GenericPrincipal(gi, rolesCookie.Value.Split('|'));
        Context.User = gp;
        }
}

and on another page, they get the user name from this code:

string strUserName = HttpContext.Current.User.Identity.Name;

Unfortunately, I'm missing the login screen.

How is the user name being set?

Is it possible to do something like:

HttpContext.Current.User.Identity.Name = "johndoe";

?

thanks



Relevant Pages

  • Re: Error Message-Programs Leave Window I am Working In-Super Slow
    ... I may be missing something cause I am by no means a computer expert. ... When I am working w/a program - I can have only one window open - ... I have Norton Internet Security which I keep updated. ... "They who would give up an essential liberty for temporary security, ...
    (microsoft.public.windowsxp.general)
  • Re: "connection timed out" problem
    ... concept has a bring problem that cannot be solved by that packet filter. ... Host security is important as well. ... net stop DnsCache & net start DnsCache ... or missing altogether. ...
    (comp.security.firewalls)
  • Re: Web - Multiple ImageButtons calling the came function
    ... Create your event handler as follows. ... protected void ImageButtonClick(object sender, ... > the security implementation. ... > whatever's easier to point to a server-side function). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Missing security tab
    ... >>When I right click a folder and choose properties, ... > If the file system is NOT NTFS, you will have no Security tab. ... The Security tab is missing when I open a users Properties in Active Directory Users and Computers? ...
    (microsoft.public.win2000.file_system)
  • Re: Missing Security Tab for drive/folders
    ... make Security tab working. ... I'd suggest you to perform a comparison to XP Pro with regards to the feature you are missing. ... >> I've included the following components and registry data: ...
    (microsoft.public.windowsxp.embedded)