目前我正在使用以下代码访问亚马逊组织服务:
<!DOCTYPE html>
<html>
<head>
<title>AWS SDK for JavaScript - Sample Application</title>
<script src="http://localhost:8000/aws-sdk-2.417.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="results"></div>
<script type="text/javascript">
var params = {}
AWS.config.update({
region: 'us-east-1',
accessKeyId: '***********',
secretAccessKey: '*************'
});
var organizations = new AWS.Organizations();
organizations.listAccounts(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else // successful response
var accts = []
console.log(data)
$('#results').append("<ul id='newList'></ul>");
for(var i = 0; i < data['Accounts'].length; i++) {
$("#newList").append("<li>"+ data['Accounts'][i]['Id'] + ":" + data['Accounts'][i]['Name']+"</li>");
accts.push({"id": data['Accounts'][i]['Id'], "name": data['Accounts'][i]['Name']});
}
console.log(accts);
});
</script>
</body>
</html>
在我的生产系统中,有没有一种方法可以让客户使用他们的 AWS 账户登录,然后无需获取访问密钥和密钥?