问题描述
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
- 如何从AWS API网关发送WWW身份验证
- 在Jetty客户端上有任何修复程序吗?
我尝试在1. AWS API网关响应-处理4002.集成响应-处理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 on1. AWS API gateway response - to handle 4002. 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 Unauthorized
和WWW-Authenticate
标头(表明您通过API Gateway进行了精细操作并且必须通过服务器进行身份验证)之间的区别,或者API网关发送401 Unauthorized
和WWW-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",并且码头用户无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!