first off, im brand new to using cloudant, so this has been a very steep learning curve for me. any help is appreciated. All the information ive been able to find thus far has been from seemingly out of date SO posts from a few years ago.
I have set up a service which is showing up correctly in my resource list:
If I click on that service, I can see the service credentials are made correctly for it (info redacted):
{
"apikey": "********************************************",
"host": "******************-bluemix.cloudantnosqldb.appdomain.cloud",
"url": "https://***********-bluemix.cloudantnosqldb.appdomain.cloud",
"username": "***********-bluemix"
}
But, when I try to access this with these credentials in pouchDB with the following code:
let db = new PouchDB(userCredentials.url, {
auth: {
username: 'userCredentials.username',
password: 'userCredentials.apiKey'
}
});
I am met with an error that it was unable to authenticate with bad username or password.
Ive also tried going through the IAM management section and using the service credentials there, making sure that my credentials have API keys attached. when using that method, I set my auth object to username: apikeyname, and password: actual key value. but every time, i am still getting the same authentication error.
Any insights anyone has would be a huge help! A few notes, I have made sure CORS is enabled, and I have the authentication setting set to IAM only (legacy login is disabled)
As you have requested an IAM-only authentication account, you can't use basic auth. Unfortunately, there's no support for IAM in PouchDB at the time of writing.