Reputation: 303
I'm coding this in Java(Android). I've followed the Google+ sign in guide and have set up the oauth client for google. I've created the AWS user pool and have added users to it through the AWS Cognito SDK. My problem is how can I get the google users added to the cognito user pool. I've gotten it to add to an identity pool but since identity pools don't have triggers I won't be able to execute my lambda functions. Any help would be greatly appreciated!
Upvotes: 2
Views: 1597
Reputation: 791
To do this you should enable federation with Google in your user pools and use the hosted UI feature. You can find detailed information in the link below, however I will try to summarize the process here - http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social.html. http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-integration.html.
Cognito allows users to sign-in through an external federated identity provider. This is designed to work with Amazon Cognito's hosted UI feature. So, if federation with Google and hosted UI options are enabled your user-pool, when your users try to sign-in, they will be presented options to sign-in with Google or sign-up and sign-in with their username and password. However, you will have to use a different Cognito Android SDK in you app.
To enable hosted UI option: 1) Start by creating a domain your user pool on Cognito console - http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain.html. 2) Enable federation with Google - http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social.html. 3) Add Cognito Auth Android SDK in you app - https://github.com/awslabs/aws-sdk-android-samples/tree/master/AmazonCognitoAuthDemo.
Upvotes: 2