AWS Amplify配置文件

时间:2018-07-27 17:48:18

标签: angular amazon-web-services amazon-cognito aws-amplify

我使用Angular和Amplify。 当我使用生成的配置对象(使用“ aws_cognito_identity_pool_id”,“ aws_user_pools_id”等字段复制到src的对象时),我可以使用组件进行身份验证。

但是当我提供自己的配置对象时:

export const awsConfig = {
  Auth: {
    // REQUIRED - Amazon Cognito Identity Pool ID
    identityPoolId: 'eu-west-1:XXX48cXX-XXXX-XXXX-XXXX-2572XXXXX2XX',
    // REQUIRED - Amazon Cognito Region
    region: 'eu-west-1',
    // OPTIONAL - Amazon Cognito User Pool ID
    userPoolId: 'eu-west-1_XXXSXXXX',
    // OPTIONAL - Amazon Cognito Web Client ID
    userPoolWebClientId: 'XXXXoefiXXXXomXXXjq4XXX',
  },
  API: {
    endpoints: [
      {
        name: 'endpointDAO',
        endpoint: `https://api.my-custom-cloudfront-domain.com`
      },
      {
        name: 'MyCustomCloudFrontApi',
        endpoint: 'https://api.my-custom-cloudfront-domain.com',
      }
    ]
  }
}

我遇到错误

1 validation error detected: Value at 'clientId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w+]+

我读到它通常是由提供用户池ID而不是身份池引起的,但我认为情况并非如此。

我做错了什么?

0 个答案:

没有答案