【发布时间】:2019-08-05 10:37:06
【问题描述】:
MongoDB Atlas API(生成程序化 API 密钥)返回两个标头
验证成功后,它会返回两个响应 401 的标头和另一个响应 200(带数据)的标头
curl -i -u "<username>:<apiKey>" --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/<group-id>/databaseUsers/admin/<dbusername>?pretty=true"
HTTP/2 401
www-authenticate: Digest realm="MMS Public API", domain="", nonce="/xGsFcHm0TT69utb5fj0AQGKV85ihlY7", algorithm=MD5, qop="auth", stale=false
content-type: application/json
date: Mon, 05 Aug 2019 10:28:16 GMT
content-length: 106
HTTP/2 401
www-authenticate: Digest realm="MMS Public API", domain="", nonce="cpvM848g/8JJfZ42OyaD7xt4365jP3kI", algorithm=MD5, qop="auth", stale=false
content-type: application/json
date: Mon, 05 Aug 2019 10:28:16 GMT
content-length: 106
{
"reason" : "Unauthorized",
"error" : 401,
"detail" : "You are not authorized for this resource."
}
它应该只返回一个标题而不是两个
【问题讨论】:
标签: mongodb mongodb-atlas