Saturday, 25 May 2019

Setting Authorization Headers in IBM API Connect Test and Monitor

I've recently started exploring the IBM API Connect Test and Monitor tool on IBM Cloud here: -

https://www.ibm.com/cloud/api-connect/api-test

and was having some fun n' games setting an HTTP Header, using either the basic HTTP Client or the more detailed Test Composer.

My API requires that one send an IAM token, rather than the more Basic Auth of user/password, which is nice :-)

This kept failing with HTTP403 Unauthorized.

Thankfully IBM have a nice active support community on Stack Overflow, so I posted a question here: -

Setting Authorization Headers in IBM API Connect Test and Monitor

and got some rapid feedback from the community.

In essence, I was doing it wrong ....

This is what I needed to do: -




In other words, for the Key/Value Pair (KVP) that comprises the HTTP Header field, I needed to specify Authorization as the key and Bearer XXXXXXXXXXXXXXX as the value ( with a space between the word Bearer and the actual IAM token itself.

So I was holding it wrong .... #Doofus

Apart from the basic HTTP Client, there's also a very spiffing Test Composer, that has the same requirement wrt Authorisation headers: -



For the record, there's also a GitHub project for a native client here: -

https://ibm-apiconnect.github.io/test-and-monitor/

with which I've played a wee bit .....

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...