Created
August 27, 2018 01:51
-
-
Save fmayoral/1c186f3813649ec11effa34782a298e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Publisher<MutableHttpResponse<?>> doFilter(final HttpRequest<?> request, final ServerFilterChain chain) { | |
if ( !isExcludedFromTokenExchange(request) ){ | |
final String exchangedToken = request.getHeaders().getAuthorization() | |
.map(keyCloakTokenExchangeService::exchangeToken) | |
.orElse(null); | |
request.getHeaders.set(HttpHeaders.AUTHORIZATION, exchangedToken); | |
} | |
return chain.proceed(request);; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment