Customizing the detection module

Updated: June 1, 2010

Applies To: Unified Access Gateway

Forefront Unified Access Gateway (UAG) includes a detection module that detects the device that is connecting to the InternalSite and portal. The detection module determines which portal will be presented to the device: Computer or Other computer, Premium mobile or Non-premium mobile.

The Forefront UAG portal and the InternalSite each have a detection module. The portal files are located in the ...\von\PortalHomePage and ...\von\PortalHomePage\App_Browsers\DetectionModule folders. The InternalSite files are located in the ...\von\InternalSite and ...\von\InternalSite\App_Browsers\DetectionModule folders.

Each detection module uses two files:

  • mobile.browser—Used to define the devices.

  • web.config—Contains the parameters to be copied from the mobile.browser file, and the expressions that will be evaluated to determine the device.

The parameters defined in the web.config file are in the format:

<DetectionParameter Name="Browser" BrowserCapabilityName="Browser" Type="String" />
<DetectionParameter Name="Mobile" BrowserCapabilityName="IsMobileDevice" Type="Boolean" />

The expressions are defined in the format:

<DetectionExpression Name="Vista" Expression='UserAgent Contains "windows nt 6.0"' />

Each expression can be based on the parameters defined in the DetectionParameters section and the parameter “UserAgent”. The expressions can contain the following operators: ! (not), AND, OR, LT (less than), GT (greater than), LTE (less than or equal to), GTE (greater than or equal to), and Contains (parameter X contains string Y – case insensitive).

The following procedure describes how to modify the web.config file.

Important

  • If you have deployed a Forefront UAG array, you must manually replicate any changes on all array members.

  • If you export the configuration, your customized files are not included in the exported configuration.

  • If you apply a service pack, update, or hotfix to Forefront UAG, your customized files might be overwritten and your customizations lost.

To modify the web.config file

  1. Open the web.config file that you want to modify (for the InternalSite or for the portal).

  2. To create a new parameter, locate the capability in the mobile.browser file and create a new detection parameter in the web.config file:

    <DetectionParameter Name="Mobile" BrowserCapabilityName="<capability_name>" Type="<capability_type>" />
    
  3. To create a new expression, for example, to allow Nokia mobile devices to access the Premium mobile site, create a new expression to identify Nokia devices:

    <DetectionExpression Name="Nokia" Expression='Platform Contains "Nokia"' DefaultValue="false"/>
    

    and then modify the PremiumMobile expression to include the new Nokia expression:

    <DetectionExpression Name="PremiumMobile" Expression='Mobile AND !UnsupportedBrowser AND (WindowsCE OR Platform Contains "iPhone" OR Nokia)' DefaultValue="false"/>