We are building an app that requires social logins (Apple, Facebook, Instagram, Google, etc) and also phone number login (where the user receives a code via SMS to login)
This is a similar sign-in model to Tinder/Bumble dating apps
We are using AWS for our backend and want to use AWS Cognito for our Authorization/Authentication I am having difficulty finding out a way to get AWS Cognito working with our setup:
Currently, AWS Cognito provides 2 ways of authorization.
- Cognito User Pools
- Cognito Identity Pool
We have developed the Phone number login method with User Pool and the social login methods i.e. Google and Facebook are Federated via. Identity Pool.
The issue with the Federated Signing-in method is that the JWT tokens are not returned by Cognito, instead, temporary AWS credentials are returned (which for now works efficiently with the system).
But since AWS does not allow us to use two authorizers at a time, we then needed to use the temporary credentials instead of JWT tokens provided by the user pool. The issue here is that the temporary credentials get expired in a maximum time of 12 hours from the time they have been issued and in case of phone number login, the user needs to then login back to generate the credentials again which degrades the User Experience.
Though Google and Facebook log in can also be integrated via User Pool and retrieve JWT Token in return, the issue is that a UI hosted by Cognito appears which again prompts the user with several login methods used in the app, which again is a bad UX as user needs to tap on Sign-in in with Facebook twice to sign-in.
Is there a way to have Phone number login/social login without:
- Using Hosted UI (My understanding is that the Hosted UI cannot be changed to appear how we want, ie: like our original sign-in page designs)
- Forcing the user to log in again ever 12 hours
- Forcing the user to log in twice (once in our app and once in the Cognito provided UI)
Thank you for your time