@ Override public void filter ( ClientRequestContext requestContext ) { // if ( requestContext == null || jwt == null || requestContext . getHeaders ( ) . containsKey ( "Authorization" ) ) { return ; } if ( header == null || header . equals ( "" ) ) { header = "Authorization" ; } final String headerValue ; if ( "Authorization" . equals ( header ) ) { headerValue = "Bearer " + jwt ; } else { headerValue = jwt ; } requestContext . getHeaders ( ) . add ( header , headerValue ) ; }
Adds the JWT token to the Authorization header in the jax - rs client requests to propagate the token .