使用adminInitiateAuth对AppSync请求进行身份验证

编程入门 行业动态 更新时间:2024-10-25 00:29:03
本文介绍了使用adminInitiateAuth对AppSync请求进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

read.acloud.guru/backend-graphql-how-to-trigger-an-aws-appsync-mutation-from-aws-lambda-eda13ebc96c3 描述了一种调用AppSync的好方法假设使用了AppSync上的IAM身份验证,就可以使用来自Lambda的简单HTTP请求进行突变,但是我希望能够使用AMAZON_COGNITO_USER_POOLS进行此操作。

The post on read.acloud.guru/backend-graphql-how-to-trigger-an-aws-appsync-mutation-from-aws-lambda-eda13ebc96c3 describes a nice way to call AppSync mutations using a simple HTTP requests from a Lambda assuming that IAM authentication is being used on AppSync, but I would like to be able to do this with AMAZON_COGNITO_USER_POOLS.

使用IAM凭证对请求进行签名即可完成此操作。据我所确定,当使用AMAZON_COGNITO_USER_POOLS时,请求未签名,但带有JWT令牌,但我正在努力寻找有关此工作原理的详细信息。 AWS.CognitoIdentityServiceProvider提供adminInitiateAuth作为在Lambda中获取用户池令牌的简便方法,但是我不知道如何使用这些令牌来验证AppSync的HTTP请求。我可以只将它们放在特定的标头中,还是过程更复杂?

The way it is done there is by signing the request using IAM credentials. As far as I could determine, when AMAZON_COGNITO_USER_POOLS is used, the requests are not signed but come with a JWT token but I am struggling to find details on how this works. AWS.CognitoIdentityServiceProvider provides adminInitiateAuth as an easy way to get User Pool tokens inside a Lambda but I have no idea how to use these tokens to authenticate HTTP requests for AppSync. Can I just put them in a specific header or is the process more complicated?

推荐答案

您必须将其传递给授权标头。

You will have to pass it to the authorization header.

更多推荐

使用adminInitiateAuth对AppSync请求进行身份验证

本文发布于:2023-10-10 01:27:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1477314.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   adminInitiateAuth   AppSync

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!