首页 > 解决方案 > How to access AWS.AppSyc based GraphQL endpoint using AWS SDK for .Net

问题描述

I created a AWS AppSync based GraphQL endpoint, which can be accessed by IAM users only. Now I want to consume this endpoint in C#.net. How can I access it via C#.Net.

I already tried APIKey authentication with GraphQL client library. But, not sure how to access same endpoint with AWS SDK.

标签: c#aws-appsyncaws-sdk-net

解决方案


There is no SDK available for AWS AppSync - Data Plane API in AWS SDK for .NET. However there is an SDK for Control Plane Operations.

In order to use IAM based authorization for calls to AWS AppSync, you need to have valid Access Key and Secret Access Key and sign the HTTP requests sent to AWS AppSync using AWS SigV4 algorithm. You can take a look at the signing algorithm here.

You can use the Access and Secret Access Keys of an IAM user in your AWS account or you can use Amazon Cognito Identity Pools to retrieve short lived AWS Credentials that can be used to sign the HTTP request sent to AWS AppSync.

You can take a look at our implementation on iOS and Android for reference.


推荐阅读