0

I spent two days googling for a solution. But couldn't find a proper solution. I am provided with the following information.

Cognito Identity pool ids: 
INT: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
CRT: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PSS: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PREPROD: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
PROD: "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Api url : https://xxxxxxxxxxxxxxxx.appsync-api.us-east-2.amazonaws.com/graphql
Api id : 63xxxxxxxxxxxxxxxxxx
Appsync name : TheAppSyncName
Authorization mechanism : IAM auth

I found there are few different ways to do this in Android, https://github.com/awslabs/aws-mobile-appsync-sdk-android

But no example could be found with .net c# AWS sdk.

Can someone please explain the meaning of the above values and how it can be used to call the graphql API in .net C#?

Update: After trying multiple times I ended up without any solution. Then I found the appsync can't be used with the given information in c# .net. I was provided with the AWS account number and unauth role ARN in addition to above.

  • You mention Cognito User Pools, however, you list your Authorization Method as IAM. Are you using [multiple authorizations](https://aws.amazon.com/blogs/mobile/using-multiple-authorization-types-with-aws-appsync-graphql-apis/)? – T Caines Feb 13 '20 at 17:53
  • No I'm not using multiple authorizations. But these are the details i'm provided with with no description at all. I would like to know a way of getting this done, in any of the 4 ways of authentication. – Hareendra Chamara Philips Feb 14 '20 at 08:21

1 Answers1

5

The answer here will provide you with some context about the AWS SDK.

As that answer mentions, the AWS SDK does not provide a way invoke your API. To invoke you API it is as simple as making a post request to your API url. There are a lot of answers about using postman for AppSync, which will help you understand the topic:

Once you understand that you should be able to do the same with any HTTP client of your choosing.

T Caines
  • 223
  • 1
  • 5
  • 1
    I ended up using the HTTP client in .net. https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html gave an overview. But this git repo (https://github.com/FantasticFiasco/aws-signature-version-4) saved a lot of time for me. In addition, I had to get the AWS account number in order to use the CognitoAWSCredentials. Will post the complete answer for others reference in a while. – Hareendra Chamara Philips Feb 18 '20 at 05:26