How to access AWS.AppSyc based GraphQL endpoint using AWS SDK for .Net

余生长醉 提交于 2021-01-29 07:25:42

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/56492202/how-to-access-aws-appsyc-based-graphql-endpoint-using-aws-sdk-for-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!