How to get user attributes (username, email, etc.) using cognito identity id

后端 未结 7 798
不思量自难忘°
不思量自难忘° 2020-12-08 06:28

I have AWS Cognito Identity Pool that is configured with Cognito User Pool as an authentication provider.

Assume I have identity ID of an identity in Cognito Identit

7条回答
  •  醉酒成梦
    2020-12-08 07:24

    Just struggled with this for a while, and the way I got the user name, using Java API is:

    identityManager.login(this, new DefaultSignInResultHandler() {
            @Override
            public void onSuccess(Activity activity, IdentityProvider identityProvider) {
                ...               
                String userName = ((CognitoUserPoolsSignInProvider) identityProvider).getCognitoUserPool().getCurrentUser().getUserId();
    

提交回复
热议问题