是否有可能创建一个身份源来从Cookie中读取JWT?

0

【以下的问题经过翻译处理】 我有一个客户正在研究API Gateway,但不想编写自定义授权程序,而是想使用本机JWT集成。

客户已经深入研究了HTTP API,并知道HTTP API可以通过指定 $request.header.Authorization 作为身份来源来使用JWT授权(https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html)。

有一种身份来源的描述,但不清楚如何或是否可能引用Cookie:https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.identity-sources

这是否可能,或者我们是否有解决方法?

profile picture
EXPERT
demandé il y a 6 mois0 vues
1 réponse
0

【以下的回答经过翻译处理】 从文档中可以看到,对于 JWT,单个入口来指定从入站请求中提取 JSON 网络令牌(JWT)的位置。目前只支持基于头和基于查询参数的选择,例如 $request.header.Authorization.JWT。

作为解决方法,您可以使用Lambda授权程序来获取完整请求并验证令牌。

profile picture
EXPERT
répondu il y a 6 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions