Highlighted
JHakvoort
New Member.
1622 views

Form fill auto submit problem

I do a form fill with user credentials on the following form:

<form name="aspnetForm" method="post" action="auraiclogin.aspx" id="aspnetForm">

<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="btnLogin" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjc3MDc4MDE5D2QWAmYPZBYCAgMPZBYGAgEPDxYCHhBDYXVzZXNWYWxpZGF0aW9uaGRkAgMPDxYCHwBoZGQCBQ8WAh4JaW5uZXJodG1sBQhJbmxvZ2dlbmQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFC2N0bDAwJGJ0bk5MBQtjdGwwMCRidG5FTgUTY3RsMDAkQ1BIMSRidG5Mb2dpbpTeh2fT7hSELVmh4Gar9x0gJ0oM" />

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>

<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="ED028FA2" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwK3jtSrDQKi84qrBQLsoOuAAT1PMHgSyxKO1j/0ocz6T4OlwpFJ" />
<input type="image" name="ctl00$btnNL" id="ctl00_btnNL" title="Nederlands" class="TaalVlag" src="images/nl.png" alt="NL" style="border-width:0px;" />
<input type="image" name="ctl00$btnEN" id="ctl00_btnEN" title="English" class="TaalVlag" src="images/uk.png" alt="EN" style="border-width:0px;" />



<input class="dxeEditArea_Aqua dxeEditAreaSys " name="ctl00$CPH1$tbUserId" onkeyup="aspxEKeyUp('ctl00_CPH1_tbUserId', event)" maxlength="50" id="ctl00_CPH1_tbUserId_I" onblur="aspxELostFocus('ctl00_CPH1_tbUserId')" onfocus="aspxEGotFocus('ctl00_CPH1_tbUserId')" onchange="aspxEValueChanged('ctl00_CPH1_tbUserId')" type="text">

<input class="dxeEditArea_Aqua dxeEditAreaSys" onkeydown="aspxEKeyDown('ctl00_CPH1_tbWachtwoord', event)" name="ctl00$CPH1$tbWachtwoord" onkeyup="aspxEKeyUp('ctl00_CPH1_tbWachtwoord', event)" maxlength="20" id="ctl00_CPH1_tbWachtwoord_I" onblur="aspxELostFocus('ctl00_CPH1_tbWachtwoord')" onfocus="aspxEGotFocus('ctl00_CPH1_tbWachtwoord')" onchange="aspxEValueChanged('ctl00_CPH1_tbWachtwoord')" type="password">

<input value="" onfocus="aspxBGotFocus('ctl00_CPH1_btnLogin')" type="button" name="ctl00$CPH1$btnLogin" style="border-width:0px;height:0px;width:0px;padding:0px;font-size:0;" />


The original page (http://pieterzandt.auralibrary.nl/auraiclogin.aspx) is actually more complicated, but I've simplified it (removing all the unnecessary elements, including javascripts) to the point that,
after AccessManager fills in the credentials, and when I manually click the loginbutton, it will login (this is with auto-submit disabled).
But if I turn on auto-submit, the browser enters into an endless loop. This has been tested with javascript enabled and disabled, neither.

Kind regards, Jacob
0 Likes
3 Replies
JHakvoort
New Member.

Re: Form fill auto submit problem

Can someone see what I am doing wrong?

Kind regards, Jacob
0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Form fill auto submit problem

JHakvoort wrote:

>
> Can someone see what I am doing wrong?
>
> Kind regards, Jacob


Rather than hacking the hell out of your login page which makes support
from your vendor quite hard try the following:

create a formfill policy that injects the following two values:

Matching criteria:

Form name: aspnetForm

Input field name: ctl00$CPH1$tbUserId
type: text
value: username i guess

input field name: ctl00$CPH1$tbWachtwoord
type: password
value: ldap password?

auto submit: true

Tick enable javascript handling and add under 'statements to execute on
submit':
document.getElementsByName("ctl00$CPH1$btnLogin").click(); (this is the
part that you might have to play with).

This might cause the page to show in the browser though as the
javascript engine of the browser has to wait for the entire page to
load. If you dont want this to happen add a 'Inject javascript' and
enable 'At the beginning of the body block'. Then under the javascript
part add:
<script>document.body.style.display="none";</script>


--
Cheers,
Edward
0 Likes
Knowledge Partner
Knowledge Partner

Re: Form fill auto submit problem

JHakvoort wrote:

>
> but I've simplified it (removing all the
> unnecessary elements, including javascripts)


How are you simplifying this? serverside or via rewriter rules?

> But if I turn on auto-submit, the browser enters into an
> endless loop.


What NAM version are you running?
Alex McHugh - Knowledge Partner - Stavanger, Norway
Who are the Knowledge Partners
If you appreciate my comments, please click the Like button.
If I have resolved your issue, please click the Accept as Solution button.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.