How to Add a Drop-down Menu with Domain Names on Logon Page of NetScaler Gateway with Symphony Theme

How to Add a Drop-down Menu with Domain Names on Logon Page of NetScaler Gateway with Symphony Theme

book

Article ID: CTX131978

calendar_today

Updated On:

Description

This article describes how to add a drop-down menu with pre-selected domains on the NetScaler Gateway logon page with Symphony theme.

Background

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.


Instructions

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:

Customization Required on the NetScaler Gateway Logon Page

To update the Access Gateway Logon page, complete the following steps:

  1. 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.

  2. 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.

  3. Open the index.html using a text editor, such as Notepad.

  4. Search for the text, “ns_showpwd”.

    </tr>
    <SCRIPT language=JavaScript>ns_showpwd();</SCRIPT>
    </tr>
    
    
  5. 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>
    
    
  6. 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.

  7. Save the index.html file and copy the file to /netscaler/ns_gui/vpn directory on the NetScaler appliance or NetScaler VPX instance.

  8. Open the en.xml file using a text editor, such as Notepad.

  9. Search for the following string, “User_name”.

  10. Update the string that is in boldface in the following code snippet:

    <String id="User_name">User&amp;nbsp;name:</String>
        <String id="Domain">Domain:</String>^M
    <Property id="Enter user name" property="title">Enter user name</Property>
    
    
  11. Save the en.xml file and copy the file to /netscaler/ns_gui/vpn/resources directory on the NetScaler appliance or NetScaler VPX instance.

  12. Refresh the NetScaler Gateway logon page.

NetScaler Configuration

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.

Persisting the Customization Changes Through a Restart

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

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to add a drop-down menu with pre-selected domains on the NetScaler Gateway logon page with Symphony theme.

Additional Information

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