获取适用于AWS STS的authenticRoleWithSAML

时间:2019-07-08 04:32:31

标签: javascript node.js amazon-web-services aws-sdk

我无法理解如何获取SAMLAssertion令牌以作为STS方法的参数之一进行传递->假定为RoleWithSAML。

请帮助我了解我已经完成DOC 用于承担RolesWithSAML。

我正在使用的代码片段,

var params = {
  PrincipalArn: 'arn:aws:iam::12345678910:user/userAccount',
  RoleArn: 'arn:aws:iam::12345678910:role/admin',
  SAMLAssertion: 'a4FameaC4Twkfjhsadkfjhsfkhsdfsdhafislahsdfaiughdiguhdfiughdfiughdagiuhdafgiusfhdaiiiilholfjpwfmwpefmo;ivnjeiuvneinveiovnA==',
};

var stsPromise = new AWS.STS({ apiVersion: '2011-06-15' }).assumeRoleWithSAML(params).promise();

它说,

'Invalid base64 SAMLResponse (Service: AWSOpenIdDiscoveryService; Status Code
: 400; Error Code: AuthSamlInvalidSamlResponseException; Request ID: b38250b8-39
dc-4188-9bdd-a69c102a5168)'

请帮助我了解SAMLAssertions要传递什么价值?还有其他我可以调用的AWS服务吗?

0 个答案:

没有答案