IBM Support

LI79326: API CONNECT: SCHEMA VALIDATION FAILS IF AN AUTHORIZATION HEADER IS PASSED BY THE CLIENT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Using an incoming request header containing an Authorization
    header with a validate policy results in the policy failing.
    
    For example:
    
    1- Create an open API with a JSON validate policy such as:
      validate:
              title: validate
              description: validateJson
              definition: '#/definitions/inputmessage'
    
    2- Add the API to a product and publish it
    3- Execute the command:
    
    curl --request POST \
      -k \
      --url
    https://<host>/<organization>/<catalog>/testjsonvalidation/test\
      --header 'accept: application/json' \
      --header 'content-type: application/json' \
      --header 'x-ibm-client-id: <clien-id>' \
      --header 'Authorization: Bearer <bearer>' \
      --data '{"FirstName":"John","LastName":"Doe"}'
    
    Results in the response:
    
    { "httpCode":"404", "httpMessage":"Invalid",
    "moreInformation":"Validate REST: Unable to retrieve the schema
    required for the REST validation or the schema is not valid:
    Unable to open URL 'var://context/policyschema'" }
    

Local fix

  • WORKAROUND:
    
    Remove the token before the  validation in file
    local:///isp/policy/apim.schemavalidate/getSchema.js
    bt addinbg the following line on position 91
    "delete options.headers.Authorization;"
    
      85:           var options = {
      86:                   target : mpgwUrl,
      87:                   method : 'GET',
      88:                   timeout : 60,
      89:                   headers : headers
      90:           };
    **91:           delete options.headers.Authorization;
    =>92:           if (verbose) {
      93:               apim.console.debug(logPrefix+'getSchema.js:
    headers used in urlopen: ' +JSON.stringify(headers));
      94:           }
      95:
      96:           urlopen.open(options,function(error, response) {
    

Problem summary

  • The authorization header needed to be removed before the schema
    validation was performed.
    

Problem conclusion

  • This issue is resolved in IBM API Connect V5.0.5.0
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI79326

  • Reported component name

    API CONNECT ENT

  • Reported component ID

    5725Z2201

  • Reported release

    503

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-10-17

  • Closed date

    2016-12-07

  • Last modified date

    2016-12-07

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    API CONNECT ENT

  • Fixed component ID

    5725Z2201

Applicable component levels

  • R503 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"503","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
29 September 2021