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

半城伤御伤魂 提交于 2020-05-29 06:46:40

问题


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')


回答1:


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)?



来源:https://stackoverflow.com/questions/58037317/getting-x-amzn-remapped-www-authenticate-instead-of-www-authenticate-and-jetty

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