This article describes how to add a drop-down menu with pre-selected domains on the NetScaler Gateway logon page with Symphony theme.
If a company has multiple domains listed for different user groups, there needs an Access Gateway logon page with domain names available as a drop-down menu, so that users can select the appropriate domain. By default, the users that belong to the Single Sign-On (SSO) domain specified in the session profile can only log on to NetScaler Gateway.
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.
Complete the following procedure to add a drop-down menu on the NetScaler Gateway logon page with Symphony theme:
To update the Access Gateway Logon page, complete the following steps:
Log on to the NetScaler appliance or the NetScaler VPX instance on which the Symphony theme is applied using a file browsing utility such as WinSCP or FileZilla.
Copy the index.html file from the /netscaler/ns_gui/vpn directory and the en.xml file from the /netscaler/ns_gui/vpn/resources directory to a computer.
Open the index.html using a text editor, such as Notepad.
Search for the text, “ns_showpwd”.
</tr> <SCRIPT language=JavaScript>ns_showpwd();</SCRIPT> </tr>
Copy the following text and add after the line having ns_showpwd:
<TR> <TD align=right><SPAN id="Domain" class="CTXMSAM_LogonFont" style="padding-right:10px;"></SPAN></TD> <TD><select name="domainvalue" size="1" style="width: 100px;"> <option value="Domain1">Domain1</option> <option value="Domain2">Domain2</option> </select> </TD> </TR> <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>
Update the domain values that are in boldface in the preceding code snippet and enter the domain values that you want in the drop-down menu. In the preceding sample code snippet, Domain1 and Domain2 are the two options that can be selected for Domain from the NetScaler Gateway logon page.
Save the index.html file and copy the file to /netscaler/ns_gui/vpn directory on the NetScaler appliance or NetScaler VPX instance.
Open the en.xml file using a text editor, such as Notepad.
Search for the following string, “User_name”.
Update the string that is in boldface in the following code snippet:
<String id="User_name">User&nbsp;name:</String> <String id="Domain">Domain:</String>^M <Property id="Enter user name" property="title">Enter user name</Property>
Save the en.xml file and copy the file to /netscaler/ns_gui/vpn/resources directory on the NetScaler appliance or NetScaler VPX instance.
Refresh the NetScaler Gateway logon page.
Update the authentication policy associated with the respective domains to use the expressions “REQ.HTTP.HEADER Cookie CONTAINS Domain1” and “REQ.HTTP.HEADER Cookie CONTAINS Domain2” and bind them to the respective authentication profiles.
If the HTTP Header cookie contains Domain1, then the username and password entered is sent to the LDAP profile associated with Domain1 and authenticated if correct. Similarly, if the HTTP Header cookie contains Domain2, then the username and password entered is sent to the LDAP profile associated with Domain2.
Bind both the authentication policies to the Access Gateway virtual server and prioritize them according to your requirements.
To persist the changes after the appliance is restarted, copy the updated files to the /var/vpn directory. For more information refer to CTX122271 - How to Retain Changes and Customizations in NetScaler Appliance When NetScaler Appliance Restarts
Citrix Blog - How to apply the Symphony Theme for NetScaler Access Gateway Enterprise Edition
CTX118657 - How to Add a Drop-down Menu with Domain Names on Logon Page for NetScaler Gateway with Carbon Theme
CTX203873 - How to Add Drop-Down Menu with Domain Names on Logon Page for NetScaler Gateway 11.0 64.x and Later