Is it possible to pass a stage variables to a custom authorizer in AWS API Gateway?

大城市里の小女人 提交于 2019-12-10 10:13:03

问题


I'm currently developing an API using AWS API Gateway. I'm issuing a JSON Web Token (JWT) to my client. That JWT is signed using a secret. I'm currently storing the secret in stage variables.

I want to use a custom authorizer to validate the JWT's signature. However I can't seem to find a way of passing the stage variable containing my secret to my custom authorizer.

For the authorisation endpoint issuing the JWT, I've used Lambda Proxy Integration to pass the secret from the stage variable to my Lambda function. However there doesn't seem to be an equivalent feature for custom authorizers.


回答1:


It's not currently possible to access stage variables from your custom authorizer function. However, we are considering this for future development.

I would urge against storing secrets in stage variables and opt for a secret management solution (such as KMS) instead. KMS can be easily called from within your custom authorizer function.



来源:https://stackoverflow.com/questions/41684728/is-it-possible-to-pass-a-stage-variables-to-a-custom-authorizer-in-aws-api-gatew

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!