Db2

 View Only

DMC 3.1.5 Configuration for Cors

  • 1.  DMC 3.1.5 Configuration for Cors

    Posted Wed September 08, 2021 04:28 AM
    Hello,

    we need to activate Cors in the server.xml for the DMC. According to https://www.ibm.com/docs/en/was-liberty/base?topic=liberty-configuring-cross-origin-resource-sharing-server I have modified the file /.../ibm-datamgmtconsole/Config/server.xml:

    <server description="dsweb server">
    ...
    <cors domain="/dbapi"
    allowedOrigins="*"
    allowedMethods="GET, POST"
    allowedHeaders="accept, x-db-profile"
    allowCredentials="true"
    maxAge="3600" />

    </server>

    But after restarting the DMC the additional Headers are not sent in the response:

    curl -v -k --header "Content-Type: application/json" --request POST --data '{"userid":"abc","password":"***"}' https://10.xx.xx.xx:11081/dbapi/v4/auth/tokens
    ...
    * upload completely sent off: 47 out of 47 bytes
    < HTTP/1.1 200 OK
    < Cache-Control: no-cache,no-store
    < Pragma: no-cache
    < X-Frame-Options: DENY
    < Content-Type: application/json; charset=UTF-8
    < Content-Language: en-US
    < Transfer-Encoding: chunked
    < Date: Wed, 08 Sep 2021 08:22:14 GMT
    <
    * Connection #0 to host 10.xx.xx.xx left intact
    {"userid": ... }

    How do I get Cors working with the DMC?

    Best regards
    Henning

    ------------------------------
    Henning Bösch
    ------------------------------

    #Db2