Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting “x-amzn-Remapped-WWW-Authenticate instead of WWW-Authenticate and jetty client not able to recognise

AWS API gateway remaps WWW-Authenticate header as x-amazn-remapped-WWW-Authenticate. Our customers use java jetty client and jetty client is failing since jetty client is looking for WWW-Authenticate header

  1. How to send WWW-Authenticate from AWS API gateway
  2. Any fix on the Jetty client?

I tried to use gateway response on 1. AWS API gateway response - to handle 400 2. Integration Response - to handle 400 requests and then set the WWW-authenticate header #set($inputRoot = $input.path('$')) $input.json("$") #if($inputRoot.toString().contains("error")) #set($context.responseOverride.status = 400) #set($context.responseOverride.header.WWW-Authenticate = 'value')

like image 655
JediYogi Avatar asked Sep 21 '19 04:09

JediYogi


1 Answers

This page documents this behavior.

This behavior cannot be overwritten. If it could, how would you tell the difference between your server sending a 401 Unauthorized and a WWW-Authenticate header (indicating that you passed through API Gateway fine and you must authenticate with the server), or API Gateway sending a 401 Unauthorized and a WWW-Authenticate header (indicating that your request never reached the server and that you must authenticate with API Gateway)?

like image 142
Joey Kilpatrick Avatar answered Nov 17 '22 09:11

Joey Kilpatrick