all groups > dotnet security > august 2005 >
You're in the

dotnet security

group:

ASP.NET form-based authentication help


ASP.NET form-based authentication help Sword
8/18/2005 2:13:03 PM
dotnet security:
I have an ASP.NET application that using form-based authentication. I have a
logon page, the user can enter his user name and password – which stored on a
remote SQL server, after click the Logon button, if both are correct, the
application will redirect the user to a welcome page. It’s very simple, and
works totally fine on my localhost machine, which is installed with Windows
XP with SP2. But after I moved this application to my company’s web server,
on which I can use the www.mycompany.com type url to browser the logon page,
the page’s Click button is no longer working. I checked all the possible
reasons I can think about, such as virtual directory, user access control,
all the possible IIS and server security settings, still can’t find why it
doesn’t work on the web server, which is installed with Windows 2003 Server.
Re: ASP.NET form-based authentication help Joseph Bittman MCSD
8/18/2005 2:44:59 PM
August 18, 2005

I'm not sure what exactly you are running into? Are you getting a
SecurityException or? On XP, ASP.Net uses the ASPNET account; on Windows
Server 2003, ASP.Net uses the Network Service account.

--
Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23/
Static IP





[quoted text, click to view]

Re: ASP.NET form-based authentication help Sword
8/18/2005 2:58:41 PM
All my authentication codes are on the Click button's click event. When I
click it on the web server, nothing happened. No any error messages, no any
prompts. Just like no running codes for the event. It seems the server
doesn't run the codes at all.

[quoted text, click to view]
Re: ASP.NET form-based authentication help Joseph Bittman MCSD
8/19/2005 2:54:55 PM
August 19, 2005

I think I have seen that behavior before. I believe it was caused by some
IE setting or script error on the page that caused everything to break. One
other thing that comes to my mind is whether your button was an HTML button
that you right clicked and selected Run At Server. Then if it uses
javascript or something to call the event on the server and the production
server has that disabled, then that could be a problem? or maybe if the
client has it disabled?... is this the case about an HTML button? You might
also look in the HTML generated and see if there is some problem there. Hope
this helps!

--
Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23/
Static IP





[quoted text, click to view]

Re: ASP.NET form-based authentication help Dominick Baier [DevelopMentor]
8/20/2005 12:09:50 AM
Hello Sword,

install a tool like Fiddler (www.fiddlertool.com) and trace the traffic.
maybe this give your more information.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]


Re: ASP.NET form-based authentication help Sword
8/22/2005 8:16:12 AM
Hi, Guys,

Thanks to provide me such useful ideas. I used Fiddler to trace the HTTP
contents, but still can’t find where the problem is. And all the javascript
settings are fine on both server and client sides.

The following is the HTML page source codes, can you help me check if there
are any problems?

HTTP/1.1 200 OK
Date: Mon, 22 Aug 2005 14:41:43 GMT
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 6.0.2.5530
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Set-Cookie: ASP.NET_SessionId=tzbku3fzc5f4qxbe5trauwas; path=/
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 3483


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form name="Form1" method="post" action="Login.aspx" language="javascript"
onsubmit="if (!ValidatorOnSubmit()) return false;" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtMTA0NDYzMTY2Mjs7bDxjaGtMb2c7Pj7Cqwwna1FAYtogb4vN8QNB1TjRqg==" />

<script language="javascript" type="text/javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>


<P>Log In To Your Account</P>
<P>
<span id="myMsg"></span></P>
<P>Email:
<input name="txtEmail" type="text" id="txtEmail" /><BR>

<span id="RequiredFieldValidator1" controltovalidate="txtEmail"
errormessage="Email must not be left blank"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;width:168px;visibility:hidden;">Email must not be left
blank</span><BR>

<span id="RegularExpressionValidator1" controltovalidate="txtEmail"
errormessage="Please enter a valid email address"
evaluationfunction="RegularExpressionValidatorEvaluateIsValid"
validationexpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
style="color:Red;visibility:hidden;">Please enter a valid email
address</span></P>
<P>Password:
<input name="txtPassword" type="password" id="txtPassword" /><BR>

<span id="RequiredFieldValidator2" controltovalidate="txtPassword"
errormessage="Password must not be left blank"
evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue=""
style="color:Red;visibility:hidden;">Password must not be left
blank</span></P>
<P>
<input id="chkLog" type="checkbox" name="chkLog" /><label
for="chkLog">Remeber My User Name</label></P>
<P>
<input type="submit" name="cmdLogin" value="Login" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="cmdLogin" style="width:80px;" /></P>
<P> </P>

<script language="javascript" type="text/javascript">
<!--
var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
document.all["RegularExpressionValidator1"],
document.all["RequiredFieldValidator2"]);
// -->
</script>


<script language="javascript" type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer
== "125"))
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>


</form>
</body>
</HTML>

[quoted text, click to view]
Re: ASP.NET form-based authentication help Dominick Baier [DevelopMentor]
8/22/2005 9:43:14 AM
Hello Sword,

more interesting would be the request/response header _after_ you clicked
the login button

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]


Re: ASP.NET form-based authentication help Sword
8/22/2005 9:46:08 AM
I debugged the codes, it seems ValidatorOnSubmit() function doesn’t pass. I
know it’s form authentication related, but how this happens?

[quoted text, click to view]
Re: ASP.NET form-based authentication help Sword
8/22/2005 10:08:10 AM
Request Header:
GET /Login.aspx HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322)
Host: www.com
Proxy-Connection: Keep-Alive

Response Header:
HTTP/1.1 200 OK
Date: Mon, 22 Aug 2005 16:55:58 GMT
Server: Microsoft-IIS/6.0
MicrosoftSharePointTeamServices: 6.0.2.5530
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Set-Cookie: ASP.NET_SessionId=sfutrirokm33fy45dyr5zm45; path=/
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 3483

[quoted text, click to view]
Re: ASP.NET form-based authentication help Dominick Baier [DevelopMentor]
8/22/2005 10:09:27 AM
Hello Sword,

aah,

this usually happens if you dont have the /aspnet_client directory in the
root of your website. this can easily happen if you move wwwroot around...

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]


Re: ASP.NET form-based authentication help Sword
8/22/2005 11:31:04 AM
Yes, you are right, Dominick. After I copy the /aspnet_client directory to my
own wwwroot directory, problem solved.

Thanks again, you are so wonderful.

[quoted text, click to view]
Re: ASP.NET form-based authentication help Sword
8/22/2005 12:56:01 PM
I just found another problem. Only the computers login to our domain by using
my account can pass through, if I change to another user’s account, the
button still doesn’t working. Is there any other settings need to be done? I
checked all the security and iis settings, just can’t figure it out. Still
need help.

[quoted text, click to view]
AddThis Social Bookmark Button