Using AWS Mobile Hub to get a working sign in

1.5k Views Asked by At

I was under the impression that AWS Mobile Hub built out things for you in the sample app.

But I see on the resources page that it uses a AWS Cognito which I defined an auth and unauth roles. The app builds but I keep getting this when I try to login:

enter image description here

I have sign in enabled:

enter image description here

In this identity pool I have greated a unauth and auth roles. Then in Mobile Hub downloaded the code but still can't get login working. What am I missing?

1

There are 1 best solutions below

7
On BEST ANSWER

When using Custom login, it means that you want to authenticate the users against your backend or developer authenticated identities. This is how it works:

  1. The end user will provide credentials(username and password) on your iOS App.
  2. App will call your backend to verify the credentials.
  3. Backend will call GetOpenIdTokenForDeveloperIdentity API of Amazon Cognito for that end-user (using the username)
  4. Cognito will return an identityId associated with that username and a OpenId Connect Token to your backend and it will passed back to the Android App.
  5. Cognito SDK will use this token to call Amazon STS to get AWS credentials for the end user.

I would highly encourage you to follow our blog post and the developer guide, it explains this flow in depth. As always, if you have any questions please feel free to ask.

Thanks.