NodeJ从联合身份池中获取Accesskey密钥和会话令牌

时间:2017-11-29 06:13:29

标签: node.js amazon-web-services lambda

我无法使用aws.config.credentials.get()方法获取访问权限和密钥以及会话令牌。我拥有高于此的一切,如身份验证和角色工作。

AWS.Config.credentials = new AWS.CognitoIdentityCredentials({
                IdentityPoolId: poolid,
                'cognito-idp.us-east-1.amazonaws.com/us-east-1_aWAJIClAA' : result.getIdToken().getJwtToken()
            });
            console.log("Config.credentials "+ AWS.Config.credentials);

            AWS.Config.credentials.get(function () {
                console.log("credentials called ", AWS.Config.credentials);
                // Credentials will be available when this function is called.

                console.log("Access Key" + AWS.Config.credentials.accessKeyId );

                console.log("Secret Key" + AWS.Config.credentials.secretAccessKey );

                console.log("Session Token" + AWS.Config.credentials.sessionToken );

0 个答案:

没有答案