I have configured AWS Cognito User Pool and added Google as a social identity provider.
- On the Cognito side, I created a mobile client for my user pool.
- On the Google Cloud side, I created a web client and added the client ID and secret into Cognito.
- I can already see Google as a federated IdP in my Cognito console.
Now I’m stuck on the Flutter app integration part.
My questions:
- How do I use
google_sign_inin Flutter to authenticate with Google and then pass the ID token to Cognito? - Do I need to call Cognito’s
/oauth2/tokenendpoint manually, or is there a better way? - Is it recommended to use Amplify Auth (signInWithWebUI) for this flow instead of handling tokens manually?
- If I go with the Hosted UI option, how can I integrate it with Flutter (e.g., using
flutter_web_auth_2)?
Has anyone successfully set up Cognito User Pool login with Google Sign-In in Flutter? A sample code snippet or recommended approach would be really helpful.