0

I have a question about Amplify, especially, how to

  • connect two Amazon Cognito user pools from the same API(AppSync)
  • define in which Amazon Cognito user pool authentication is required in schema.graphql.

The following picture is what I want to achieve. Some API require user pool for user authentication, but on the other hand, others require user pool for admin.

  • API's have to be able to see the same Dynamo DB.

Example

Satoru Kikuchi
  • 1,069
  • 2
  • 21
  • 33
  • 1
    Appsync does support multiple cognito user pools , but unfortunately amplify does not support it , see there is currently open issue right now https://github.com/aws-amplify/amplify-cli/issues/4853 – sakhunzai Jul 13 '21 at 18:27

1 Answers1

0

Amplify doesn't support multiple user pools. However, you could achieve something similar using user groups: https://docs.amplify.aws/cli/auth/groups

Then when you're working with the API, you could use authorization rules: https://docs.amplify.aws/cli/graphql-transformer/auth#multiple-authorization-rules

There's a blog post about it here: https://aws.amazon.com/blogs/mobile/aws-amplify-allows-you-to-mix-and-match-authorization-modes-in-datastore/

Kilo Loco
  • 529
  • 5
  • 10