ASP.net Authentication question
From: Simon Harvey (simon.harvey_at_the-web-works.co.uk)
Date: 03/23/04
- Next message: Ravichandran J.V.: "Re: SortCommand events not being caught"
- Previous message: Kareem Shaker: "RE: datagrid?"
- Next in thread: Simon Harvey: "Re: ASP.net Authentication question"
- Reply: Simon Harvey: "Re: ASP.net Authentication question"
- Reply: anonymous_at_discussions.microsoft.com: "ASP.net Authentication question"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 11:30:35 -0000
Hi everyone,
I'm hoping that someone can help me with the following:
I don't know to much about asp.net security, but I've copied the following
code out of one of microsofts security books. What I'm trying to achieve is
allow a user access to a secured directory only once his details have been
validated. The directory in question "/secure/" is specified in a location
element of the web.config file. The code in question is in my login page and
is:
if(SystemUserLogic.validateUser(username, password)){
authTicket = new FormsAuthenticationTicket(username, false, 15);
encryptedTicket = FormsAuthentication.Encrypt(authTicket);
authCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
encryptedTicket);
Response.Redirect("secure/index.aspx");
}
The problem is that asp.net is denying access to the secure directory even
once I have do the above.
Can anyone see what I have missed out?
Am I right in thinking that this is all I have to do?
Thanks to anyone who can help
Simon
- Next message: Ravichandran J.V.: "Re: SortCommand events not being caught"
- Previous message: Kareem Shaker: "RE: datagrid?"
- Next in thread: Simon Harvey: "Re: ASP.net Authentication question"
- Reply: Simon Harvey: "Re: ASP.net Authentication question"
- Reply: anonymous_at_discussions.microsoft.com: "ASP.net Authentication question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|