MongoDB Atlas api返回两个头

MongoDB Atlas api返回两个头,mongodb,mongodb-atlas,Mongodb,Mongodb Atlas,MongoDB Atlas API(生成一个编程API键)返回两个头 身份验证成功后,它返回两个带有401响应的头,另一个带有200(带有数据)响应的头 curl-i-u:“--digest”https://cloud.mongodb.com/api/atlas/v1.0/groups//databaseUsers/admin/?pretty=true" HTTP/2 401 www-authenticate:Digest-realm=“MMS公共API”,domain=“,nonce=“/xG

MongoDB Atlas API(生成一个编程API键)返回两个头

身份验证成功后,它返回两个带有401响应的头,另一个带有200(带有数据)响应的头

curl-i-u:“--digest”https://cloud.mongodb.com/api/atlas/v1.0/groups//databaseUsers/admin/?pretty=true"
HTTP/2 401
www-authenticate:Digest-realm=“MMS公共API”,domain=“,nonce=“/xGsFcHm0TT69utb5fj0AQGKV85ihlY7”,algorithm=MD5,qop=“auth”,stale=false
内容类型:application/json
日期:2019年8月5日星期一10:28:16 GMT
内容长度:106
HTTP/2 401
www-authenticate:Digest-realm=“MMS-Public-API”,domain=“”,nonce=“cpvM848g/8jfz42oyad7xt4365jp3ki”,algorithm=MD5,qop=“auth”,stale=false
内容类型:application/json
日期:2019年8月5日星期一10:28:16 GMT
内容长度:106
{
“原因”:“未经授权”,
“错误”:401,
“详细信息”:“您未获得此资源的授权。”
}

它应该只返回一个头,而不是两个头,这就是摘要身份验证的工作方式

请阅读以下wiki文章中名为示例的部分及其解释


另请注意,文档中没有提到,但用户名是公钥,密码是编程api密钥的私钥。

这就是摘要身份验证的工作原理

请阅读以下wiki文章中名为示例的部分及其解释

还要注意的是,文档中没有提到,但用户名是公钥,密码是编程api密钥的私钥

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."
}