我知道有相关的答案,但是我需要获取所有与用户相关的详细信息,例如用户名,创建日期,MFA身份验证及其所有内容。
我已经尝试过此代码。
BasicAWSCredentials awsCreds = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY);
AWSCognitoIdentityProvider cognitoIdentityProvider = AWSCognitoIdentityProviderClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
.withRegion(Regions.fromName(AWS_REGION)).build();
ListUsersRequest req = new ListUsersRequest();
req = req.withUserPoolId(AWS_USER_POOL_ID);
List<String> attributesToGet = new ArrayList<String>();
attributesToGet.add("email");
ListUsersResult response = cognitoIdentityProvider.listUsers(req);
List<UserType> userType = response.getUsers();
for (UserType getUser : userType) {
System.out.println(getUser.getUserCreateDate());
}
但是我没有得到任何预期的结果。