获取"x-amzn-Remapped-WWW-Authenticate"而不是"WWW-Authenticate",并且码头用户无法识别 [英] Getting “x-amzn-Remapped-WWW-Authenticate instead of WWW-Authenticate and jetty client not able to recognise

查看:137
本文介绍了获取"x-amzn-Remapped-WWW-Authenticate"而不是"WWW-Authenticate",并且码头用户无法识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS API网关将WWW-Authenticate标头重新映射为x-amazn-remapped-WWW-Authenticate.我们的客户使用Java Jetty客户端,而Jetty客户端失败,因为Jetty客户端正在寻找WWW-Authenticate标头

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. 如何从AWS API网关发送WWW身份验证
  2. 在Jetty客户端上有任何修复程序吗?

我尝试在 1. AWS API网关响应-处理400 2.集成响应-处理400个请求,然后设置WWW-authenticate标头 #set($inputRoot = $input.path('$')) $input.json("$") #if($inputRoot.toString().contains("error")) #set($context.responseOverride.status = 400) #set($context.responseOverride.header.WWW-Authenticate = 'value')

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

推荐答案

此页面记录了这种行为.

此行为不能被覆盖.如果可以,您如何区分服务器发送401 UnauthorizedWWW-Authenticate标头(表明您通过API Gateway进行了精细操作并且必须通过服务器进行身份验证)之间的区别,或者API网关发送401 UnauthorizedWWW-Authenticate标头(表明您的请求从未到达服务器,并且您必须通过API Gateway进行身份验证)?

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

这篇关于获取"x-amzn-Remapped-WWW-Authenticate"而不是"WWW-Authenticate",并且码头用户无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆