获取亚马逊访问键和放大器;从IAM用户名在Java中的秘密钥匙 [英] Get Amazon Access Key & Secret Key from IAM Username in Java

查看:358
本文介绍了获取亚马逊访问键和放大器;从IAM用户名在Java中的秘密钥匙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我碰到从Amazon访问键在Java中

但唯一不同的是我想达到的完全相反:是否有可能获得访问密钥和放大器;密钥通过使用IAM创建的用户名来执行的Java SDK操作?

But the only difference is I want to achieve the exact opposite: Is it possible to get the access key & secret key to perform Java SDK operations by using the username created in IAM?

我想,当用户用他的IAM凭据,他可以启动和停止的应用程序实例登录到构建应用程序。但要做到这一点,我需要访问和放大器;该用户的秘密密钥。

I want to build an application when the user logs in with his IAM credentials he can start and stop instances in the application. But to do that I need the access & secret key of that user.

我希望有人能帮助我,或知道一个解决方法我的问题。

I hope someone can help me or knows a workaround for my problem.

感谢您!

推荐答案

假设你的应用程序都有自己的各自足够的AWS安全证书(例如,通过与的 IAM角色的Amazon EC2 ),您可以通过手段实现这一目标< A HREF =htt​​p://docs.aws.amazon.com/IAM/latest/APIReference/API_ListAccessKeys.html相对=nofollow> ListAccessKeys API操作:

Assuming your application has respectively sufficient AWS security credentials of its own (e.g. by running on an EC2 instance with an IAM Role for Amazon EC2), you can achieve this by means of the ListAccessKeys API action:

返回关于与指定用户关联的访问密钥ID的信息。如果没有任何的动作返回一个空列表。

Returns information about the access key IDs associated with the specified user. If there are none, the action returns an empty list.

这个API操作在 AWS SDK暴露的Java 的作为<一个href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/identitymanagement/AmazonIdentityManagement.html#listAccessKeys()"相对=nofollow> listAccessKeys()。

This API action is exposed in the AWS SDK for Java as listAccessKeys().

这篇关于获取亚马逊访问键和放大器;从IAM用户名在Java中的秘密钥匙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆