We have implemented a Developer Identity Provider using our custom user auth service and we have an Identity Pool connected to it with many Identities saved. Right now, we're evaluating to move our user table to a User Pool connected to the same Identity Pool and use the mobile-hub library.

The question is: After the import, could Cognito detects if a user with a specific username already exists in the Identity Pool and doesn't create it again (with another Identity)? Self signup is activated.

UPDATE for clarification: Our identity pool has near 1000 existing identities. All of them were created before the existence of User Pool feature. They were created using the "Developer Authenticated Identities Authflow" (check link), and the external "Developer Provider" is a simple user table. Each identityId in the Identity Pool is associated to an existing identity (record) in our external user table.

Now we want to use AWS Mobile-hub lib in our iOS app and a User Pool connected with the existing Identity Pool. We want to start adding new users to our User Pool but for existing users, they already have an identity created in the Identity Pool. What to do in that case?

Seems to be that, at the moment of first login, Cognito doesn't have a mechanism to detect if a user already has an IdentityId created by another auth flow (Facebook, Developer Provider).

1

There are 1 answers

0
Jeff Bailey On BEST ANSWER

You could do one of a few things, because as you noted, Cognito does not totally handle this for you.

If you're all in on user pools, you could use the import user feature to transfer your users.

Alternatively, on sign in, you could check if the username exists in your user table. If so, you could either sign them in by that, or you could transfer them over to user pools then and there with a lazy load.