How to hide Storefront store from NetScaler Gateway

How to hide Storefront store from NetScaler Gateway

book

Article ID: CTX227266

calendar_today

Updated On:

Description

This article address a workaround to hide multiple stores' choice when adding account via NetScaler Gateway in Workspace at the fist time.  
 


Instructions

Since the store that prompted for user to select depends on the provision file returned by StoreFront, we can bind a rewrite policy in NetScaler Gateway to modify the provision file.

e.g.
>You have multiple stores setup in storefront, "store1", "store2" and "xd76Store2".
>The "xd76Store2" is only allowed for end-user access via NetScaler Gateway.
>You may apply below configuration in NetScaler.

1. Configure Pattern Sets to list hidden store name, eg. store1, store2
  • GUI 
    • Navigate to AppExpert>>Pattern Sets, Click Add 
    • Input a Name, eg. StoresRemove
    • Click Insert to add ">store1<" and ">store2<"  
      • NOTE: the inputted store name format is fixed with ">store<" and case sensitive.
      • image.pngimage.png
  • CLI:
    • >add policy patset StoresRemove
      >bind policy patset StoresRemove ">store2<" -index 1
      >bind policy patset StoresRemove ">store1<" -index 2

2. Configure Rewrite action to refer Pattern Sets
  • GUI 
image.png
  • CLI:
    • >add rewrite action StoresRM delete_all "HTTP.RES.BODY(82000)" -search "patset(\"StoresRemove\")" -refineSearch "EXTEND(70,1500).REGEX_SELECT(re#<account>.*\\s*<\\/account>#)"
       

3. Configure Rewrite policy
  • GUI 
    • image.png
  • CLI:
    • add rewrite policy Pl_storesRM "HTTP.RES.BODY(1000).CONTAINS(\"accounts\")" StoresRM

4. bind the rewrite policy to the Gateway Virtual Server (e.g. AG) as Response Type.
image.png 
NS CLI: bind vpn vserver AG -policy Pl_storesRM -priority 100 -gotoPriorityExpression END -type RESPONSE

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.