How to use the requested Url after a successful log-on

The requested Url is the Url which triggered the display of the HTML login form. For example, there is no requested Url with a login form displayed on a home page. In order to use the requested Url after a successful log on, the Url in question must be known by the filter. This information must be provided to the filter with the authentication request as INPUT fields "CNXDATA" or "URL".

1. With  token "CNXDATA"

a. with a text login form msg, add the following field the HTML form:

        <INPUT type=hidden name="CNXDATA" value="#CNXDATA#">

b. with a Url login form msg, add the token "CNXDATA" in the query string of the "login form msg":

   url:/session/logonform.asp?cnxdata=#cnxdata#

        and, insert the field value in the login form script:

   <INPUT type=hidden name="CNXDATA" value="<%= request.querystring("CNXDATA") %>">
 

2. With token "URL"

a. with a text login form msg, add the following field the HTML form:

    <INPUT type=hidden name="URL" value="#URL#">

b. with a Url login form msg, add the token "URL" in the query string of the login form msg:

   url:/session/logonform.asp?URL=#URL#

        and, insert the field value in the login form script:

   <INPUT type=hidden name="URL" value="<%= request.querystring("URL") %>">
 


Once the requested Url is known (as described above) by the filter, it may be used in several ways, for example:

1. To redirect the client to the requested Url

In the DAF configuration Tool, in Security Handler Settings, tab "Login Form Type", Uncheck option "always forward to the Protected Home page". With this setting, the client is always redirected towards the requested Url, if it exists and is known.

Another solution, consist in using HTML input field "UrlOnSuccess"

a. Add the "URL" token to login form msg

with a text login form msg, add the following field the HTML form:

    <INPUT type=hidden name="UrlOnSuccess" value="#URL#">

with a Url login form msg, add the token URL in the query string:

   url:/session/logonform.asp?URL=#URL#

        insert the field in the login form:

   <INPUT type=hidden name="UrlOnSuccess" value="<%= request.querystring("URL") %>">
 

See also: How to use "UrlOnSuccess" HTML input field

2. To read the requested Url in the procted home page script

With the DAF configuration Tool, in the Security Handler Settings, add the "URL" token to the query string of your "Protected area home page Url"

    url:/dafdemoprv/ProtectedHomePage.asp?Url=#Url#

With these settings the protected home script will be called with the Url in the query string:

    http://192.168.0.4/dafdemoprv/ProtectedHomePage.asp?Url=/protected/