I have a half-way running app where the user can sign-up via form or via Facebook.
I am trying to do the following and I was wondering whether this aligns with AWS Cognito best practises or not.
Sign-Up:
- Sign-up form ("local user"): User can enter username/password with details (gender, bday etc). The credentials get stored in a AWS Cognito User Pool and all other profile details in a custom database.
- Sign-up via Facebook: User can hit the Facebook login button on the page and after he is authenticated, he has to fill out missing information (gender, bday etc) if not provided by FB. The profile info will be stored in the same database as for a user signing-up through the form.
Pools:
- The AWS user pool is connected as a identity provider in my AWS identity pool.
- Facebook is connected to same identity pool.
Token handling:
- "Local user": I get based on the identityId from the user pool the credentials from the identity pool. I use this credentials to access resources on AWS. The credentials will be cached on the client in a secure place.
- Facebook user: The same procedure as for "local user".
My questions:
- Does the overall approach make sense or are there things that do not align with the design of AWS Cognito?
- I save all profile information ("local user" and Facebook user) in my own database because I need more advanced query/search capabilities on the profile info. Cognito does not offer sophisticated search capabilities. Is it a bad practise if I separate from User Pool resp. the User Pool stores only username/password of local users? What are the disadvantages of this approach?
- Should I create a user in the user pool for every Facebook identity? If yes, why?