We have seen how to use a JWT to authorize access to services. In addition to this coarse-grained access control, we can also leverage the claims in the JWT to perform fine-grained, role-based access control. In this recipe, we will show how to use directives to create annotations that are used to define role-based permissions declaratively in a GraphQL schema.
Authorizing a GraphQL-based service
Getting ready
You will need the Cognito user pool created in the Creating a federated identity pool recipe and the sample application created in the Implementing sign up, sign in, and sign out recipe to create the identity token used in this recipe. You will need to assign the Author group, via the Cognito Console, to the user that...