Skip to content
Advertisement

AWS Appsync Graphql Java Client – IAM authorisation

This is the schema for which I have implement business logic

JavaScript

I use RestTemplate as my Java client to consume graphql endpoint giving API key as authorization. I ad dthe api key in the header paart as x-api-key.

JavaScript

The above implementation retrieves the values from the backend. But according the schema which is defined by the other team, the authorization mode is not API key rather iam. So I have to configure the rest template accordingly.

Where in the Client side code in Java I can configure so that aws_iam is used as authorization method to retrieve the information from the endpoint. Dynamodb is the datasource

Advertisement

Answer

Building the request object like below helps:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement