newbie seeks User.Identity and Application_AuthenticateRequest help
From: Mad Scientist Jr (usenet_daughter_at_yahoo.com)
Date: 05/27/04
- Next message: John Saunders: "Re: Multiple web.config files in a virtual directory"
- Previous message: Joseph E Shook [MVP - ADSI]: "Re: Forms Authentication and classic ASP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
- Next message: John Saunders: "Re: Multiple web.config files in a virtual directory"
- Previous message: Joseph E Shook [MVP - ADSI]: "Re: Forms Authentication and classic ASP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|