Ask a Question related to ASP.NET Security, Design and Development.
-
AndrewV #1
Forms Authentication does not work when using computer name
Greetings,
My asp.net app is using Forms Authentication. Running the project from the
Visual Studio .NET 2003 has absolutely no problem. I use the sample from
[url]http://www.eggheadcafe.com/articles/20020906.asp[/url] as the forms authentication
framework. But it doesn't work when the page is accessed directly via an
independent IE. ie. [url]http://ComputerName/MyApp/default.aspx[/url]. After clicking
the Login button, the authentication code run with no error, but the Login
page kept getting reloaded and reloaded. I installed the app on a second
computer to repeat the same test on that computer, and still run into the
same problem. Testing is done on the same computer as the iis hosting the
asp.net application, all single machine.
However, accessing the page with either [url]http://localhost/MyApp/default.aspx[/url]
or [url]http://ip#.xx.xx/MyApp/default.aspx[/url] is working fine.
It's really strange, because it is the same code, on the same computer,
works from VS.NET IDE, localhost, ip, but not computer name.
Your input is greatly appreciated.
Andrew.
My IIS is version V5.1, OS is WinXPPro, .NET framework is version 1.1.
1. Excerpt from my config file
<authentication mode="Forms">
<forms name="FormsAuthDB.AspxAuth" loginUrl="login.aspx"
protection="All" timeout ="10" path="/"/>
</authentication>
<authorization>
<deny users="?" />
<allow users="*"/>
</authorization>
2. Code from Application_AuthenticateRequest
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.User != null)
{
FormsIdentity fi = (FormsIdentity)HttpContext.Current.User.Identity;
FormsAuthenticationTicket fat = fi.Ticket;
string userData = fat.UserData;
string[] roles = userData.Split(',');
// Create a new Generic Principal Instance and assign to Current User
HttpContext.Current.User = new
System.Security.Principal.GenericPrincipal(fi, roles);
}
}
AndrewV Guest
-
Forms authentication doesn't work for downloads
Hello, I'm using Forms authentication, and it works well. If user is not authenticated, he is routed to the login page. However, this doesn't... -
ASP.NET Forms Authentication don't work on some Window XP
(Type your message here) I am working on ASP.NET project where I am using formauthentication, it seems to work fine on all OS including XPexcept on... -
forms authentication doesn't work for static pages/files like GIF/HTML/PDF ?
do I understand it correctly that forms authentication doesn't work for static pages/files like GIF/HTML/PDF ? so I cannot convince IIS to... -
Forms Authentication timeout doesn't work
I am trying to do some testing of my application with respect to timeouts (i.e. Session timeouts). I took the advice of somebody else in this... -
Unable to get Forms-based Authentication to work
Hello, I'm new to ASP.NET, and I'm trying to learn how to implement forms based authentication. However, I don't know what I'm doing wrong....



Reply With Quote

