我正在开发一个Spring Cloud Zuul网关,放在我的spring boot应用程序前面。我在应用程序端使用基本授权。当我使用正确的authorization标头调用网关时,我总是得到401未授权的消息
"status": 401,
"error": "Unauthorized",
"message": "Full authentication is required to access this resource"
但是当我直接向应用程序发出请求时,它就能工作了。
发布于 2016-08-14 03:58:13
在Zuul路由中指定不带Authorization值的sensitive-headers
属性将向应用程序转发Authorization
标头。缺省情况下,它具有以下值:Cookie,Set-Cookie,Authorization
bootstrap.yml:
zuul:
ignoredServices: '*'
routes:
application:
path: /application/**
serviceId: application
sensitive-headers: Cookie,Set-Cookie
https://stackoverflow.com/questions/38936470
复制相似问题