问题
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