AWS API Gateway Custom Authorization with Lambda

You can define and use your own custom authorization model on API Gateway with Lambda. Each method is able to use different authorization models.
This post includes AWS API Gateway, Lambda and JWT

First of all we need to create a Lambda function to do Auth process and validate JWT and then we’ll use it on API Gateway.

fj_authorization

Now we need to define Custom Authorization on API Gateway.

apigateway_lambda_custom_authorization_1
apigateway_lambda_custom_authorization_2

  1. Lambda function name
  2. Authorization token source.

apigateway_lambda_custom_authorization_3 apigateway_lambda_custom_authorization_4

 

apigateway_lambda_custom_authorization_5

Now every request calling this method firstly authorizated by fj_authorization function if JWT token is valid.

Leave a Reply

Your email address will not be published. Required fields are marked *