Authenticating with IBM Cloudant DB with API Key fails

83 Views Asked by At

I've got a database set up on IBM Cloudant. I'm trying to access it with serverless actions elsewhere on IBM Cloud. Cloudant is configured with an API Key and password combo to give the user read/write/replicate access. The docs here say to authenticate by making a string of username:password, encoding that in Base4 and sticking it in an Authorization header. I've used the APIKey as the username. When I call an action using postman to add a new document, I'm able to execute the action, but I get a 401 error with the response: "The resource requires authentication, which was not supplied with the request".

My question is how do I authenticate with Cloudant? Or perhaps it's how do I authenticate using an API key with Cloudant? The frustrating thing is that when I'm within the action and invoke it, everything works fine. It's only on external sources such as postman that it fails. This tells me that something is authenticating from my browser (which is also logged into the cloudant db), but I don't know if that sheds any light on the issue. I'm using the base 64 encoding found at https://www.base64encode.org/. I'm using python, if that matters.

0

There are 0 best solutions below