如何使用适用于.Net的AWS开发工具包访问基于AWS.AppSyc的GraphQL终端节点 [英] How to access AWS.AppSyc based GraphQL endpoint using AWS SDK for .Net

查看:92
本文介绍了如何使用适用于.Net的AWS开发工具包访问基于AWS.AppSyc的GraphQL终端节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个基于AWS AppSync的GraphQL终端节点,只有IAM用户可以访问该终端节点.现在,我想在C#.net中使用此终结点.如何通过C#.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.

我已经尝试使用GraphQL客户端库进行APIKey身份验证.但是,不确定如何使用AWS开发工具包访问同一终端节点.

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

推荐答案

AWS SDK for .NET中没有适用于AWS AppSync的SDK-数据平面API.但是,有一个控制平面操作.

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.

为了使用基于IAM的授权来调用AWS AppSync,您需要具有有效的访问密钥和秘密访问密钥,并使用AWS SigV4算法对发送到AWS AppSync的HTTP请求进行签名.您可以在此处查看签名算法.

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.

您可以在您的AWS账户中使用IAM用户的访问和秘密访问密钥,也可以使用

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.

您可以在 iOS Android 供参考.

这篇关于如何使用适用于.Net的AWS开发工具包访问基于AWS.AppSyc的GraphQL终端节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆