Rules for HTTP basic authentication

Add rules to define an HTTP basic authentication policy that is named worklight-basicauth.

You create the worklight-basicauth policy as part of the process of defining a multiprotocol gateway. See Integrating with DataPower as a security gateway and reverse proxy, Table 1.

Table 1. HTTP Basic Authentication properties
Property Value
Policy Name worklight-basicauth
Order of configured rules
  1. worklight-basicauth_rule_0: see Table 2
  2. worklight-basicauth_rule_3: see Table 5
  3. worklight-basicauth_rule_1: see Table 3
  4. worklight-basicauth_rule_2: see Table 4
Table 2. Properties of worklight-basicauth_rule_0. When processing HTML content, skip processing with the icon that is associated with the website or the web page.
Property Value
Direction Client to Server or Both Directions.
Match
  • Type = URL
  • Pattern = /favicon.ico
Advanced "Set Variable" -> var://service/mpgw/skip-backside = 1
Result Not applicable.
Table 3. Properties of worklight-basicauth_rule_1. Handle end-user authentication if an LTPA token does not exist.
Property Value
Direction Client to Server.
Match
  • Type = URL
  • Pattern = *
AAA BasicAuth2LTPA
  • Output: NULL
Result Not applicable.
Table 4. Properties of worklight-basicauth_rule_2. Handle both the redirect and content-type reset on the response side.
Property Value
Direction Server to Client.
Match
  • Type = URL
  • Pattern = *
Filter Provide a custom stylesheet that handles redirect and content-type rewrite. For a sample redirect stylesheet, see Sample redirect stylesheet.
  • Output: NULL
Result Not applicable.
Table 5. Properties of worklight-basicauth_rule_3. Because the policy is applied to each request, the rules must be ordered such as to ensure that an LTPA token is verified if it exists in the HTTP request. If no token is available, proceed to the next rule and authenticate the user.
Property Value
Direction Client to Server.
Match
  • Type = HTTP
  • HTTP header tag = Cookie
  • HTTP value match = *LtpaToken*
AAA VerifyLTPA
  • Output: NULL
Result Not applicable.