我无法使用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 );