使用IdentityServer中的访问令牌访问AWS API网关 [英] access AWS API gateway using access token from identityserver
问题描述
我们已经使用身份服务器实现了身份服务器
We have our identity server implemented using identity server
https://github.com/IdentityServer/IdentityServer3
或
https ://github.com/IdentityServer/IdentityServer4
用户将进行身份验证并从身份服务器获取访问令牌。我们在AWS api网关中开发了一些API。只是想知道在aws api网关中实现身份验证/授权的常见做法是什么。我们希望使用API网关中身份服务器提供的现有访问令牌。
And user will authenticate and get the access token from the identity server. We have some APIs developed in AWS api gateway. Just wondering what is the common practice to implement the authentication / authorization in the aws api gateway. We would prefer to use the existing access token from the identity server in the API gateway.
推荐答案
您将需要配置<您的API网关上的code>自定义授权者。定制授权者将使用Lambda函数来验证访问令牌。您将需要配置Lambda函数以根据您的令牌进行验证。以下是一些资源,可帮助您使用Lambda函数配置API网关自定义授权器:
You will need to configure a custom authorizer
on your API Gateway. The Custom Authorizer will use a Lambda Function to validate the Access Token. You will need to configure the Lambda Function to validate accordingly to your token. Here are some resources to help you configure the API Gateway Custom Authorizer with Lambda Function:
- 使用API网关Lambda授权者
- < a href = https://aws.amazon.com/blogs/compute/introducing-custom-authorizers-in-amazon-api-gateway/ rel = nofollow noreferrer> API网关和Lambda中的自定义授权者
- Use API Gateway Lambda Authorizers
- Custom Authorizers in API Gateway and Lambda
这篇关于使用IdentityServer中的访问令牌访问AWS API网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!