Retrieve data from AWS Cognito using Boto3

与世无争的帅哥 提交于 2019-12-13 03:19:01

问题


I am using AWS Cognito to authenticate user, been successfully in storing user details like username, lastname, address etc. But unable to find any relevant methods to retrieve data stored in Cognito using Boto3.

Is it possible to retrieve user data in AWS Cognito or I should store them in RDS?


回答1:


Yes, you can do this by using the get_user method.

  • UserAttributes (list) -- An array of name-value pairs representing user attributes.

    For custom attributes, you must prepend the custom: prefix to the attribute name.

    • (dict) -- Specifies whether the attribute is standard or custom.

      • Name (string) -- The name of the attribute.

      • Value (string) -- The value of the attribute.




回答2:


You can use list-users to list your users, but you won't be able to list all the users at once from Cognito without a third party tool since there's a limit on number of users per request. You should use Cognito-Triggers to store your user in an RDS or DynamoDB, if you want to be able to retrieve all your users.



来源:https://stackoverflow.com/questions/54703889/retrieve-data-from-aws-cognito-using-boto3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!