Creating an Inject JavaScript Policy

The Inject JavaScript policy adds the configured JavaScript to a protected resource page, when used in the interactive mode. You can create a standalone Inject JavaScript policy. You can also use this policy with the Form Fill policy. When you use the Form Fill policy with this one, configure the actions in the following sequence:

  1. Form Login Failure policy

  2. Form Fill policy

  3. Inject JavaScript policy

When the Inject JavaScript policy is configured along with the Form Fill policy, ensure that Auto Submit is not enabled for the Form Fill policy. In the Configure Javascripts section, select the option where you want to insert JavaScript in the HTML page. The following are examples based on the option you have selected.

In the head block

Selecting this option inserts the following JavaScript in the header:

<html>
<head>
<script language="JavaScript">
alert("Head");
</script>

At the beginning of the body block

Selecting this option inserts the following JavaScript just after the <body> tag.

<title> Test Java Script</title>
</head>
<body>
<script language="JavaScript">
alert("Begin Body");
</script>

At the end of the body block

Selecting this option inserts the following JavaScript just before the </body> tag.

BODY starts. <br>
Inject Java Script. <br>
BODY ends. <br>
<script language="JavaScript">
alert("End Body");
</script>
</body>
</html>

To create an Inject JavaScript policy:

  1. Click Policies > Policies.

  2. Select the policy container, then click New.

  3. Specify a name for the policy, select Access Gateway: Form Fill as its Type, then click OK.

  4. In the Actions section, click New > Inject JavaScript.

  5. In the Form Selection section, select the criteria. If you are creating a standalone Inject JavaScript policy, specify the criteria. For more information, see Using CGI Matching Criteria and Using Page Matching Criteria. When you use the Inject JavaScript policy with the Form Fill policy, it uses the same criteria as that of the Form Fill policy.

    NOTE:If you do not specify a criteria in the Form Selection section, the Inject JavaScript policy is applied to all protected resource pages.

  6. Click OK > Apply Changes.

  7. Continue with Assigning a Form Fill Policy to a Protected Resource.