6

Summary:

I can't find the Android code to authenticate a Google user with my Cognito User Pool.

Detail:

Here is what I have done so far:

  1. Created a Cognito User Pool and a User Client in that user pool
  2. Created a Google Web App in Google Console
  3. Configured Google as a Federated Identity Provider in my Cognito User Pool (providing Google Client Id and Secret)
  4. Tried the Hosted UI from the AWS Console and verified that I am able to sign in using my Google credentials, the user gets created in the User Pool.

Okay, next step: Implement the sign in flow in Android. I want to implement both Google sign-in as well as username-password signup/sign-in in my Android app. I am able to successfully implement username/password signup and sign-in flow in my app, here is how:

  1. I create a CognitoUserPool instance using my user pool id and user client id
  2. I used methods signUpInBackground and getSessionInBackground of CognitoUserPool and CognitoUser respectively.

Now, I want to enable Google sign in. I cannot find any code on how to do this using CognitoUserPool. I found code samples to do this using Cognito Identity Pool. But I haven't created an Identity Pool and since I am able to login using Google on the Hosted UI sample, I am pretty sure I don't need it.

Questions:

  1. Do I really need an Identity Pool to enable Google sign in on my Android app? Why?
  2. If not, are there any code samples which show how to enable Google sign in using CognitoUserPools?

Any pointers appreciated.

Bonton255
  • 2,231
  • 3
  • 28
  • 44
  • 1
    Did you get any solution? Looks aws android sdk is so unmaintained. AWS Amplify doesn't work with my android app too, so I am using AWSCognito sdk – Jaydeep Jun 22 '20 at 08:21

0 Answers0