如何使用 AWS API 在请求中传递访问凭证

编程入门 行业动态 更新时间:2024-10-24 20:12:08
本文介绍了如何使用 AWS API 在请求中传递访问凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试使用 AWS API 传递请求,但出现此错误

I'm trying to pass a request with AWS API but I get this error

AWS was not able to validate the provided access credentials

我的要求是:

https://ec2.amazonaws/?Action=RunInstances&ImageId=ami-6df1e514&KeyName=key1&InstanceType=t2.micro&Placement.AvailabilityZone=us-west-2&AWSSecretAccessKey=**********************&AWSAccessKeyId=******************

我的访问凭据是正确的,这一点毫无疑问.我发现问题可能是由时钟延迟引起的,但我的 PC 的时钟是正确的.谁能帮帮我,我没有找到解决办法.

My access credentials are right, there is no doubt about that. I found that the problem could be caused by clock delay but My PC's clock is correct. Could someone help me, I did not find a solution.

推荐答案

在进行 API 调用时,您从不将您的秘密访问密钥发送到 AWS.相反,您使用访问/秘密密钥签署您的请求(如 此处).您可以在此处阅读有关签署的更多信息.

You never send your secret access key to AWS when making an API call. Instead, you sign your request with the access/secret keys (as described here). You can read more about signing here.

理想情况下,使用 JavaScript SDK 而不是手动生成 查询请求.

Ideally, use the JavaScript SDK rather than manually generating query requests.

您还应该旋转您使用的凭据,因为您已经公开了密钥.

You should also rotate the credentials that you were using because you have exposed the secret key.

这篇关于如何使用 AWS API 在请求中传递访问凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 03:44:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/928416.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:凭证   如何使用   AWS   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!