AWS API Gateway access headers using HTTP proxy?

I am using AWS API Gateway and its HTTP proxy,

I need to transfer the authorization header to my endpoint via AWS API Gateway

Things I tried:

Setting method e.g.

Method Request

Configure integration request enter image description here

This does not work, my application does not receive the authorization header,

I also tried using a pattern matching

{
  "method": "$context.httpMethod",
  "body" : $input.json('$'),
  "headers": {
    #foreach($param in $input.params().header.keySet())
    "$param": "$util.escapeJavaScript($input.params().header.get($param))" #if($foreach.hasNext),#end

    #end
  },
  "queryParams": {
    #foreach($param in $input.params().querystring.keySet())
    "$param": "$util.escapeJavaScript($input.params().querystring.get($param))" #if($foreach.hasNext),#end

    #end
  },
  "pathParams": {
    #foreach($param in $input.params().path.keySet())
    "$param": "$util.escapeJavaScript($input.params().path.get($param))" #if($foreach.hasNext),#end

    #end
  }  
}

This also did not work.

Can someone give me some hint on how this can be done?

+4
source share
1 answer

API Gateway AWS SigV4 - . , OAuth, .

+1

Source: https://habr.com/ru/post/1626019/


All Articles