Hi,
I am having difficulties in setting up the authentication for Restful api.
I use the following command to get the token (obviously myuser, mypwd and myserver have concrete values):
TOKEN=$(curl -s -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"userid":"<myuser>","password":"<mypwd>"}'
http://<myserver>/dbapi/v4/auth/tokens | jq -r '.id_token')
and then I try to use it like this:
curl -X GET
http://<myserver>/dbapi/v4/monitor -H 'authorization: Bearer ${TOKEN}' -H 'content-type: application/json'
But I get the following response:
{"trace":"","errors":[{"code":"authentication_failure","message":"HWCSEC0003E: Invalid authentication token","target":{"type":"","name":""},"more_info":""}]}
I can login to the console with the same user and password I used above. What I am doing wrong?
------------------------------
Petri Helin
------------------------------
#Db2