问题
I want to authenticate user using AWS Cognito. If user authenticated by username and password then I can identify him using AWS session, I can logout him using AWS. But if user authenticated using facebook or google then he does not get into user pool. First, I should initialize user in facebook and google, then I can get credentials from AWS using tokens from facebook and google. Logout button should execute logout function from facebook and google SDK.
I want to add user to user pool when user sign up using facebook and google. Is it possible?
回答1:
The ability to combine Facebook/Google federation with Cognito User Pools was added late in 2017. The documentation is a is available here: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social.html
Essentially you can connect an external social service with your Cognito User Pool by configuring it in the "Federation > Identity Providers" section when viewing your user pool in the AWS web console. You authorize the scopes you need and link them to user pool attributes. Then when someone federates with the external system, a Cognito user is created in your user pool with the corresponding values.
来源:https://stackoverflow.com/questions/44436680/aws-cognito-how-to-add-user-to-user-pool-on-sign-up-using-federated-identities