Firebase的AWS ApiGateway自定义授权 [英] AWS ApiGateway Custom authorization with Firebase
问题描述
我将解释我的用例.我有一个网络应用程序.首先,该应用尝试尝试登录Firebase,并获取令牌.我想使用firebase发行的令牌通过api网关访问lambda函数.是否有一种机制可以在AWS ApiGateway中验证Firebase令牌?
I will explain my use case. I have a web app. First, the app attempts to login to firebase and it gets back a token. I want to use the token issued by firebase to access lambda function through api gateway. Is there a mechanism to validate Firebase tokens in AWS ApiGateway?
推荐答案
您必须编写自定义Authorizers lambda函数来验证您的Firebase令牌.
You have to write custom Authorizers lambda function for validate your firebase tokens.
此lambda函数会在执行您的lambda函数之前命中.
This lambda function hit before execute your lambda function.
下图说明了它的工作原理
following diagram explain how it's work
要编写自定义授权者函数,请遵循此参考.对于令牌验证,您可以使用firebase sdk及其引用.
For write custom Authorizers function follow this reference. For token validation you can use firebase sdk and its references.
这篇关于Firebase的AWS ApiGateway自定义授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!