Netflix / zuul

Zuul is a gateway service that provides dynamic routing, monitoring, resiliency, security, and more.
Apache License 2.0
13.52k stars 2.38k forks source link

"Authorization" Header does not pass to downstream service #501

Closed haasiniE closed 1 day ago

haasiniE commented 6 years ago

The request header "Authorization" is not being passed with Spring boot version 2.0.3 zuul to downstream services.I have disabled Authorization as sensitive header but Zuul will not send Authorization header to downstream service.

Below is the present config that will work only with the following code.

zuul: sensitiveHeaders: routes:

Versions: springBootVersion = '2.0.3.RELEASE' dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:Finchley.RELEASE"

} } compile 'org.springframework.cloud:spring-cloud-starter-netflix-zuul'

Route filter as below:

@SuppressWarnings("unchecked") @Override public Object run() {

try {   
    RequestContext ctx = RequestContext.getCurrentContext();
    ctx.addZuulRequestHeader("Authorization","Bearer xxx");
} catch(Exception ex) {
    log.error("Exception", ex);

}

Spring boot version 1.5.7 Zuul is to able to send the header "Authorization" with the to the downstream services without adding the Authorization header through RequestHeader by using route filter.

Below is the config:

zuul: sensitiveHeaders: routes:

Versions: springBootVersion = "1.5.3.RELEASE" dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:Dalston.SR1"

} } compile ‘org.springframework.cloud:spring-cloud-starter-zuul’

artgon commented 6 years ago

Please direct your question to the Spring Cloud issue tracker.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 day ago

This issue was closed because it has been stalled for 7 days with no activity.