一千萬個為什麽

搜索

AWS REST API查詢



如何通過身份驗證來進行API查詢?

https://iam.amazonaws.com/?Action=ListAttachedUserPolicies&UserName=ja&Version=2010-05-08&accesskey

得到:

MissingAuthenticationToken
Request is missing Authentication Token

轉載註明原文: AWS REST API查詢

一共有 2 個回答:

Got it working by aws curl https://github.com/okigan/awscurl

awscurl --service iam 'https://iam.amazonaws.com/?Action=ListUsers&Version=2010-05-08'

The referred documentation from the question https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListAttachedUserPolicies.html

有這個請求的例子:

https://iam.amazonaws.com/?Action=ListAttachedUserPolicies
&UserName=Alice
&Version=2010-05-08
&AUTHPARAMS

AUTHPARAMS are explained https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html

(version 4 is preferred) https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html

因此,您必須根據請求和秘密密鑰計算摘要,並且您必須完全按照文檔中的說明進行操作 - 這意味著要小心每個字母,包括空格。