使用以下基于AWS Lambda的应用程序客户端时,我试图列出来自Cognito用户池的所有用户。AWS Cognito ListUsers InvalidParameterException在自定义属性上使用AttributesToGet
let AWS = require('aws-sdk')
const COGNITO_CLIENT = new AWS.CognitoIdentityServiceProvider()
COGNITO_CLIENT.listUsers({
UserPoolId: 'MyUserPoolId',
AttributesToGet: ['default_attribute', 'custom:my_attribute']
}, callback)
默认查询所有属性时(AttributesToGet: [] // or excluding this field altogether
),一切正常。但是,如果定位自定义属性,则会引发InvalidParameterException。这是使用Amazon SDK for Node.js.
定位默认属性虽然允许:
AttributesToGet: ['email', 'name', /* other non-custom */]
确保'AttributesToGet'匹配模式'[\\ p {L} \\ p {M} \\ p {S} \\ p {N} \\ p {P}] +' –
确保客户端已经读取了自定义属性。如果该属性是在客户端之后创建的,那么默认情况下客户端无权访问它。它在客户端的详细信息中,然后单击链接来更改访问权限。 – doorstuck
我已检查并且应用程序客户端已具有读取权限。当我要求返回所有属性时,将返回自定义属性。当我使用'AttributesToGet'来定位它们时,我得到这个异常 – Nogurenn