Implementing NTLM authentication for server requests

Implement NTLM authentication where a single, shared instance of HTTP client is used per adapter for all mobile application instances.

About this task

By default, procedures that connect to a back-end server that uses NTLM protocol are handled on a server-to-server basis, as the connectAs attribute is defined as ="server". You need only configure serverIdentity of the adapter XML file as a subelement of the authentication. You also add the ntlm workstation attribute, so that MobileFirst Server knows which authentication method to use when connecting to the back end.

Procedure

  1. Open the adapter.xml file of the project.
  2. Add an authentication element as follows:
    <connectivity>
        <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
            <protocol>http</protocol>
            <domain>your-domain-here</domain>
            <port>80</port>
            <connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
            <socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
            <authentication>
                <ntlm workstation="ServerName"/>
                <serverIdentity>
                    <username>your-server-name-here/your-username-here</username>
                    <password>your-password-here</password>
                </serverIdentity>
            </authentication>
            <maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
        </connectionPolicy>
    </connectivity>
    Note: When the NTLM protocol is used, the user name must always be specified in the format: server-name/user-name. Ensure that in the adapter.xml file, you pass the server and user names to the back-end server in that pattern.

    For more information, see HTTP adapter connectionPolicy element.