未找到Cognito S3 IdentityPool

时间:2017-06-10 14:44:27

标签: node.js amazon-web-services amazon-s3 amazon-cognito

我收到错误消息 “未找到IdentityPool \'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \”。 在尝试列出所有S3存储桶时。

这是我的代码:

ListBuckets: function() {

aws.config.region = 'eu-central-1'; // 1. Enter your region

aws.config.credentials = new aws.CognitoIdentityCredentials({
    IdentityPoolId: 'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' // 2. Enter your identity pool
});

aws.config.credentials.get(function(err) {
    if (err) console.log("Error: " + err);
    console.log(aws.config.credentials);

     var s3 = new aws.S3();
    s3.listBuckets(function(err, data) {
        if (err) {
            console.log("Error", err);
        }
        else {
            console.log("Bucket List", data.Buckets);
        }
    });    });




}

这些是我的凭据:

CognitoIdentityCredentials {
expired: true,
expireTime: null,
accessKeyId: undefined,
sessionToken: undefined,
params: 
{ IdentityPoolId: 'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
 RoleSessionName: 'web-identity' },
data: null,
_identityId: null,
_clientConfig: {},
webIdentityCredentials: 
WebIdentityCredentials {
 expired: true,
 expireTime: null,
 accessKeyId: undefined,
 sessionToken: undefined,
 params: 
  { IdentityPoolId: 'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    RoleSessionName: 'web-identity' },
 data: null,
 _clientConfig: {} },
cognito: 
Service {
 config: 
  Config {
    credentials: [Circular],
    credentialProvider: [Object],
    region: 'eu-central-1',
    logger: null,
    apiVersions: {},
    apiVersion: null,
    endpoint: 'cognito-identity.eu-central-1.amazonaws.com',
    httpOptions: [Object],
    maxRetries: undefined,
    maxRedirects: 10,
    paramValidation: true,
    sslEnabled: true,
    s3ForcePathStyle: false,
    s3BucketEndpoint: false,
    s3DisableBodySigning: true,
    computeChecksums: true,
    convertResponseTypes: true,
    correctClockSkew: false,
    customUserAgent: null,
    dynamoDbCrc32: true,
    systemClockOffset: 0,
    signatureVersion: 'v4',
    signatureCache: true,
    retryDelayOptions: {},
    useAccelerateEndpoint: false,
    params: [Object] },CognitoIdentityCredentials {
 expired: true,
 expireTime: null,
 accessKeyId: undefined,
 sessionToken: undefined,
 params: 
 { IdentityPoolId: 'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
 RoleSessionName: 'web-identity' },
 data: null,
 _identityId: null,
 _clientConfig: {},
 webIdentityCredentials: 
 WebIdentityCredentials {
 expired: true,
 expireTime: null,
 accessKeyId: undefined,
 sessionToken: undefined,
 params: 
  { IdentityPoolId: 'eu-central-1:xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    RoleSessionName: 'web-identity' },
 data: null,
 _clientConfig: {} },
cognito: 
 Service {
 config: 
  Config {
    credentials: [Circular],
    credentialProvider: [Object],
    region: 'eu-central-1',
    logger: null,
    apiVersions: {},
    apiVersion: null,
    endpoint: 'cognito-identity.eu-central-1.amazonaws.com',
    httpOptions: [Object],
    maxRetries: undefined,
    maxRedirects: 10,
    paramValidation: true,
    sslEnabled: true,
    s3ForcePathStyle: false,
    s3BucketEndpoint: false,
    s3DisableBodySigning: true,
    computeChecksums: true,
    convertResponseTypes: true,
    correctClockSkew: false,
    customUserAgent: null,
    dynamoDbCrc32: true,
    systemClockOffset: 0,
    signatureVersion: 'v4',
    signatureCache: true,
    retryDelayOptions: {},
    useAccelerateEndpoint: false

有人有想法吗?区域适合,IdentityPoolId肯定存在。

0 个答案:

没有答案