Form replay allows you to open a session on a protected application by filling a <abbrtitle="HyperText Markup Language">HTML</abbr> POST login form and autosubmitting it, without asking anything to the user.
</p>
<divclass="notewarning">This kind of <abbrtitle="Single Sign On">SSO</abbr> mechanism is not clean, and can lead to problems, like local password blocking, local session not well closed, etc.
<p>
Please always try to find another solution to protect your application with <abbrtitle="LemonLDAP::NG">LL::NG</abbr>. At least, check if it is not a <ahref="applications.html"class="wikilink1"title="documentation:2.0:applications">known application</a>, or <ahref="selfmadeapplication.html"class="wikilink1"title="documentation:2.0:selfmadeapplication">try to adapt its source code</a>.
</p>
</div>
<p>
If you configure form replay with <abbrtitle="LemonLDAP::NG">LL::NG</abbr>, the Handler will detect forms to fill, add a javascript in the html page to fill form fields with dummy datas and submit it, then intercept the POST request and add POST data in the request body.
</p>
<p>
POST data can be static values or computed from user's session.
</p>
<divclass="notetip">To post user's password, you must enable <ahref="passwordstore.html"class="wikilink1"title="documentation:2.0:passwordstore">password storing</a>. In this case you will be able to use <code>$_password</code> to fill any password POST field.
<liclass="level1"><divclass="li"><abbrtitle="Uniform Resource Identifier">URI</abbr> of the html page which contains the form</div>
</li>
<liclass="level1"><divclass="li"><abbrtitle="Uniform Resource Identifier">URI</abbr> the html form is sent to</div>
</li>
<liclass="level1"><divclass="li"> Does the html page load jQuery ? If not, grab a jQuery <abbrtitle="Uniform Resource Locator">URL</abbr> reachable by user (any version over jQuery 1.0 is suitable)</div>
</li>
<liclass="level1"><divclass="li"> are there several html forms in the page ? If so, get a jQuery selector for the form you want to post</div>
</li>
<liclass="level1"><divclass="li"> is user required to click on a button, for example in order to perform some script ? If so, get a jQuery selector for that button</div>
</li>
<liclass="level1"><divclass="li"> names and values of the fields you want to control</div>
</li>
</ul>
<p>
If you don't know jQuery selector, just be aware that they are similar to css selectors: for example, button#foo points to the html button whose id is “foo”, and .bar points to all html elements of css class “bar”.
</p>
<p>
For example:
</p>
<ul>
<liclass="level1"><divclass="li"> Form page <abbrtitle="Uniform Resource Identifier">URI</abbr>: /login.php</div>
</li>
<liclass="level1"><divclass="li"> Target <abbrtitle="Uniform Resource Identifier">URI</abbr>: /process.php (if you let this parameter empty, target <abbrtitle="Uniform Resource Identifier">URI</abbr> is supposed to be the same as form page <abbrtitle="Uniform Resource Identifier">URI</abbr>)</div>
</li>
<liclass="level1"><divclass="li"> jQuery <abbrtitle="Uniform Resource Locator">URL</abbr>: http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js (if you let this parameter empty, jQuery is supposed to be already loaded; you can also set <code>default</code> to point to jQuery <abbrtitle="Uniform Resource Locator">URL</abbr> of <abbrtitle="LemonLDAP::NG">LL::NG</abbr> portal)</div>
</li>
<liclass="level1"><divclass="li"> jQuery form selector: #loginForm (if you let this parameter empty, browser will fill and submit any html form)</div>
</li>
<liclass="level1"><divclass="li"> jQuery button selector: button.validate (if you let this parameter empty, the form will be submitted but no button will be clicked; if you set it to “none”, no button will be clicked and the form will be filled but not submitted)</div>