c# - 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.
解决方案
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.
推荐阅读
- nativescript - 在 iPhone 上运行 Sidekick 项目的问题
- jquery - 下载
忽略下载属性 - json - 无效的 utf-8 起始字节 0xb0
- websphere - WSVR0009E: 启动期间发生错误,org.omg.CORBA.INTERNAL: CREATE_LISTENER_FAILED_4
- c++ - 如何在 QT 中制作模态 QProgressDialog?
- xamarin - 如何删除添加到 main() 方法的子页面?
- c# - .NET 接口如何包含数据
- java - 如何使用 JPA 处理 INSERT 中的空值?
- r - 从非对称矩阵中获取上三角矩阵
- javascript - AngularJS - Checklist-Model 在复选框更改时未正确更新模型