Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] debugging ClientRequestFilter with token


I’m trying to resolve an issue with using a token. Via curl I make a
request like

curl -H 'Authorization: Bearer d2a09f52-fd70-40be-a3d4-2d41cb549d5d'

And the response is OK. Then I try to do the same using a
ClientRequestFilter and client. I receive an error code. I tried to
look in the debugger to see what the request header looks like. I
haven’t been able to find it, but maybe I should set the breakpoint

Then I’m looking for advice regarding what I might be doing wrong, or
where I might find the request header via debugger.

class BearerTokenFilter implements ClientRequestFilter {
  private final String bearerToken;
  public BearerTokenFilter(String bearerToken){
   this.bearerToken = bearerToken;
 public static final String FILTER_HEADER_KEY = "Authorization";

  public void filter(ClientRequestContext requestContext) throws IOException {
    String bearerTokenString = "Bearer " + bearerToken;


Best Regards,

Colin Williams

Back to the top