- Integrate a user in a user pool with an identity pool to allow users to log in with their Facebook account.
Answer: In order to integrate Facebook with Amazon Cognito identity pools, you must follow the given procedure:
-
- Create a Facebook Application from the Facebook Developers portal (https://developers.facebook.com/).
- Copy the App ID and secret.
- Configure Facebook as a provider in Amazon Cognito Console:
-
- Follow the Facebook Guide (https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.3) to add the Facebook login button to the web application.
- Once the user is authenticated, a Facebook session token will be returned; this token must be added to the Amazon Cognito credentials provider to fetch a JWT token.
- Finally, add the JWT token to the API Gateway request Authorization header.
- Integrate a...