I use AWS Marketplace. When a user wants to start my app, Marketplace redirects the user to my app and POSTs a registration token.
My app takes the registration token and gets the Product Code and the CustomerIdentifier, using resolveCustomer() SDK. I then use getEntitlements() SDK to get their expiration date and an entitlement. I have not saved this anywhere yet but plan to save it on my RDS server. I then start the AWS Cognito hosted UI and Exit my app.
The user sees the hosted UI and fills in their email and password. Once they are authenticated, Cognito forwards them to my now stopped app. This time my app sees that they have no registration token and skips the resolveCustomer code, above.
This is where I am. I don't know which fields to use (from ResolveCustomer) to find the user in the UserPool or Identity Pool? I'd like to get the authenticated user's email address since I use this email identifier throughout my app.
Bottom line I've gotten their CustomerIdentifier from Marketplace and their token ID from Cognito, but how do I use these two together? I know that they then both are the same user!