This article describes how to add a drop-down menu with domain names on the logon page for NetScaler Gateway and send the authentication request to the appropriate server.
By default, the NetScaler Gateway does not have a drop-down menu with domain information.Users migrating from Access Gateway Advanced Edition might rely on this for their user base. With this configuration on the NetScaler Gateway, the administrator has the capability of even sending the authentication request to the correct Active Directory domain controller based on the domain information. It also allows an easier configuration without the need to configure groups and any domain modifications.
Note: This procedure is provided as-is. The Citrix technical support might ask you to reverse these changes when issues related to authentication occur before troubleshooting the issue. The file mentioned in this article is found in the /netscaler/ns_gui/vpn directory.
This section contains the following procedures:
To create a cookie on the computer of the user, complete the following procedure:
Note: The name of the cookie is domainvalue and it is created to store the name of the domain chosen from the drop-down menu.
Download index.html to your local machine.
Open the file for editing with preferred document editor.
Locate the following section (the last line should be line 40):
<!-- Logon box -->
<tr class="mainPane">
<td class="carbonBoxBottom" valign="bottom">
<script language="javascript" type="text/javascript">
documentWriteGlowBoxUpper();
</script>
Add the following in the next line:
<SCRIPT type="text/javascript"> function getCookie(name) { // use: getCookie("name"); var re = new RegExp(name + "=([^;]+)"); var value = re.exec(document.cookie); return (value != null) ? unescape(value[1]) : null; } var today = new Date(); var expiry = new Date(today.getTime() + 28 * 24 * 3600 * 1000); // plus 28 days var expired = new Date(today.getTime() - 24 * 3600 * 1000); // less 24 hours function setCookie(name, value) { // use: setCookie("name", value); document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString(); } function storeValues(form) { setCookie("domainvalue", form.domainvalue.value); return true; } </SCRIPT>
The next two lines should read as follows:
<FORM method="post" action="/cgi/login" name="vpnForm" autocomplete="off" style="margin:0" onSubmit="clean_name_cookie(this);">
Insert the following string into the onSubmit tag: storeValues(this);"
The HTML code should now read as follows:
<FORM method="post" action="/cgi/login" name="vpnForm" autocomplete="off" style="margin:0" onSubmit="return storeValues(this); clean_name_cookie(this);">
To create a drop-down menu, complete the following procedure:
On the same index.html page, locate the following line:
<SCRIPT language=JavaScript>ns_showpwd();</SCRIPT>
Add the following line immediately after the preceding line:
<TR><TD align=center><SPAN class="CTXMSAM_LogonFont" style="padding-right:10px;">Domain:</SPAN></TD> <TD><select name="domainvalue" size="1" style="width: 100px;"> <option value="DOMAIN1">DOMAIN1</option> <option value="DOMAIN2">DOMAIN2</option> </select> </TD></TR>
Note: DOMAIN1 must be replaced with the name you prefer for the domain. You can add as many domains as you want by adding <option value="DOMAIN">DOMAIN</option> before the </select> section.
Save the changes and copy the file to the /netscaler/ns_gui/vpn directory.
Note: Ensure that you back up the original file.
To create a procedure to ensure that the custom page endures a restart, complete the following tasks:
Connect to the appliance using an SSH client such as PuTTY.
Type shell.
Create a directory on the hard drive to save the custom file:
mkdir /var/customizations
Run the following command to copy the modified page to the new directory:
cp /netscaler/ns_gui/vpn/index.html /var/customizations/
Create a startup script file called rc.netscaler in the /nsconfig directory if it does not exist:
cd /nsconfig
touch rc.netscaler
Run the following command to copy the commands to the rc.netscaler file:
echo cp /var/customizations/index.html /netscaler/ns_gui/vpn/index.html >> /nsconfig/rc.netscaler
To modify the authentication profile to be based on the presence of the cookie instead of the default "true-value", ensure that the expression syntax is similar to the configuration, as shown in the following screen shot:
CTX131978 - How to Add a Drop-down Menu with Domain Names on Logon Page of NetScaler Gateway with Symphony Theme
CTX203873 - How to Add Drop-Down Menu with Domain Names on Logon Page for NetScaler Gateway 11.0 64.x and Later
Citrix Documentation - Customizing the User Portal on NetSaler Gateway 11.0
Citrix Blog - Re-Branding NetScaler 11 with the StoreFront 3.0 Portal Theme
For information on customization option available on NetScaler 10.0 and 10.1, refer to Citrix Blog - Citrix Access Gateway – UI Theme Customization.
The following is a logon page with the domain name: