Aws Cognito Social login

460 Views Asked by At

We want to integrate social login with aws. We get facebook token from facebook SDK then we pass it to AWS client. But It gives a below error.

Code:

 AWSMobileClient.getInstance().initialize(SignUpActivity.this, new Callback<UserStateDetails>() {
            @Override
            public void onResult(UserStateDetails result) {

                try {
                    AWSMobileClient.getInstance().federatedSignIn("graph.facebook.com", token,
                            new Callback<UserStateDetails>() {
                        @Override
                        public void onResult(final UserStateDetails userStateDetails) {
                            //Handle the result
                            Log.d("AA", "onResult: " + userStateDetails.getDetails());
                        }
                        @Override
                        public void onError(Exception e) {
                            Log.e("AAA", "sign-in error", e);
                        }
                    });
                } catch (Exception e) {
                }
            }
            @Override
            public void onError(Exception e) {
            }
        });

Caused by: com.amazonaws.AmazonServiceException: 1 validation error detected: Value 'us-east-1_xxxxxxxx' at 'identityPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+:[0-9a-f-]+ (Service: AmazonCognitoIdentity; Status Code: 400; Error Code: ValidationException; Request ID: fd3202ef-abxx-xxxx-xx7c-xxxxxxxxxxx)

Please provide us a solution. Thanks in advance.

1

There are 1 best solutions below

0
On

You're going to need to provide more details than that. What is your request to Cognito? It looks like you may be passing in the incorrect payload for the AWS request.

Check out the AWS Cognito User Pool Auth docs: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-userpools-server-contract-reference.html