I want to use Cognito & Google login for my applications. I think the way to use that is federated identities?
I think I need to use GetId
and GetOpenIdToken
to get a Cognito token for my Google user? This works but
The OpenId token is valid for 15 minutes.
Why is this token expiry so short? Is it meant for such a use case - a normal REST API? I intend to use it with API Gateway.
UPDATE
I found http://serverless-stack.com/chapters/cognito-user-pool-vs-identity-pool.html to provide a useful explaination of Federated Identity vs User Pools. Its not the same thing like I thought.
- User Pool: handles authentication, forgot password etc
- Federated Identity: Gives access to users from user pool, social logins access to AWS resources