在'identityPoolId'处检测到的验证错误未能满足约束

问题描述 投票:0回答:1

我正在使用aws-api-gateway-cli-test来测试API网关。 API通过cognito用户池进行身份验证,我收到错误消息:

1 validation error detected: Value 'eu-central-1_xxxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+

我不确定identityPoolId使用哪个值。我在哪里可以获得这些信息。

尝试像arn:aws:cognito-idp:eu-central-1:xxxxxxxxxxx:userpool/eu-central-1_xxxxxxxxxx这样的ARN失败了。格式为eu-central-1_xxxxxxxxxx的池ID也失败了。

用法示例:

npx aws-api-gateway-cli-test \
--username='user' \
--password='password' \
--user-pool-id='eu-central-1_xxxxxxx' \
--app-client-id='xxxxxxxxxxxxxxxx' \
--cognito-region='eu-central-1' \
--identity-pool-id='eu-central-1_xxxxxxxx' \
--invoke-url='https://xxxxxx.execute-api.eu-central-1.amazonaws.com/prod/' \
--api-gateway-region='eu-central-1' \
--path-template='/xxxx/xxxxx' \
--method='POST' \
--body='{"foo":"bar","lorem":"ipsum"}'

结果

1 validation error detected: Value 'eu-central-1_xxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+

根据:https://github.com/AnomalyInnovations/aws-api-gateway-cli-test

amazon-web-services aws-api-gateway amazon-cognito aws-cli
1个回答
1
投票

您可以通过转到标识池,选择您的标识池,然后单击编辑标识池来查找标识池标识。 enter image description here

您的标识池将采用以下格式:

美东1:XXXXXXXXXXXX-XXXXXXXX-XXXXXXXXXXXX

© www.soinside.com 2019 - 2024. All rights reserved.