Hello, I’m experiencing the same issue.
CORS have been enabled from *
.
This is an example credential file generated from Service Credentials
tab in IBM Cloudant: (credentials are no more valid)
{
"apikey": "9SgdXnNa4aa-LldTdaBvuwCz7b94DvRpqZuFS-zC5qLn",
"host": "968[REDACTED]e8a-bluemix.cloudantnosqldb.appdomain.cloud",
"iam_apikey_description": "Auto-generated for key 1fea9853-00ca-4583-916f-f48775f3ea53",
"iam_apikey_name": "ServiceCredentials-2",
"iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
"iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/5f41ba2949ef4a6daba1f9c11615a6da::serviceid:ServiceId-5c759f57-a419-4f8d-a051-de67de97e866",
"url": "https://[REDACTED]-bluemix.cloudantnosqldb.appdomain.cloud",
"username": "[REDACTED]-bluemix"
}
So far I tried:
-
username
and apikey
-
iam_api_keyname
and apikey
- just
[REDACTED]
and apikey
I get a 401 Unauthorized
Request headers
POST /_session HTTP/1.1
Host: [REDACTED]-bluemix.cloudantnosqldb.appdomain.cloud
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: application/json
Accept-Language: en-GB
Accept-Encoding: gzip, deflate, br
Content-type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 95
Origin: null
DNT: 1
Connection: keep-alive
Cookie: AuthSession=
Pragma: no-cache
Cache-Control: no-cache
Response headers
HTTP/2 401 Unauthorized
access-control-allow-credentials: true
access-control-allow-origin: null
access-control-expose-headers: content-type, cache-control, accept-ranges, etag, server, x-couch-request-id, x-couch-update-newrev, x-couchdb-body-time
cache-control: must-revalidate
content-length: 67
content-type: application/json
date: Tue, 15 Sep 2020 08:38:36 GMT
server: CouchDB/2.1.1 (Erlang OTP/20)
set-cookie: AuthSession=; Version=1; Path=/; HttpOnly; Secure; SameSite=None
x-cloudant-action: cloudantnosqldb.session.write
x-frame-options: ALLOW-FROM https://[REDACTED]-bluemix.cloudantnosqldb.appdomain.cloud
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-cloudant-request-class: unlimited
x-cloudant-backend: bm-cc-eu-de-11
via: 2.0 lb2.bm-cc-eu-de-11 (Glum/1.89.12)
X-Firefox-Spdy: h2
@danielo515 is there anything I can do to further debug this? I have the impression that the authentication the CouchDB library uses does not like API keys but requires username/password, but that is just an impression, I wasn’t able to determine if that’s the case from the source code.
I think this is related to Multi-User simultaneous updates possible? where login worked only after enabling Use both legacy credentials and IAM
.