使用以下基於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