Skip to content

SPARQLProtocolSession custom HTTP Header #4136

Answered by ate47
mariussl asked this question in Q&A
Discussion options

You must be logged in to vote

You can use an interceptor to add your auth header in your HttpClient, I think this code can help you:

HttpClientBuilder bld = HttpClientBuilder.create();
bld.addInterceptorFirst(
    (HttpRequestInterceptor) (httpRequest, httpContext) ->
        httpRequest.addHeader(HttpHeaders.AUTHORIZATION, "bearer JWTTOKEN")
);
CloseableHttpClient httpClient = bld.build();

You can then replace your auth header without having to recreate the HttpClient

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by abrokenjester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants