Re: ASP.NET form-based authentication help

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 08/22/05


Date: Mon, 22 Aug 2005 10:09:27 -0700

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

> I debugged the codes, it seems ValidatorOnSubmit() function doesn't
> pass. I know it's form authentication related, but how this happens?
>
> "Sword" wrote:
>
>> 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>
>> "Dominick Baier [DevelopMentor]" wrote:
>>
>>> 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
>>>> 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.
>>>>
>>>> "Joseph Bittman MCSD" wrote:
>>>>
>>>>> 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
>>>>> "Sword" <Sword@discussions.microsoft.com> wrote in message
>>>>> news:85AA77F9-2BE9-405C-A645-D372078B48B6@microsoft.com...
>>>>>> 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.
>>>>>> Anyone can help?


Quantcast