public class KeycloakSecurityContextClientRequestInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
ClientHttpRequestExecution objects created for server to server secured
communication using OAuth2 bearer tokens issued by Keycloak.| Constructor and Description |
|---|
KeycloakSecurityContextClientRequestInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected KeycloakSecurityContext |
getKeycloakSecurityContext()
|
org.springframework.http.client.ClientHttpResponse |
intercept(org.springframework.http.HttpRequest httpRequest,
byte[] bytes,
org.springframework.http.client.ClientHttpRequestExecution clientHttpRequestExecution) |
public KeycloakSecurityContextClientRequestInterceptor()
protected KeycloakSecurityContext getKeycloakSecurityContext()
KeycloakSecurityContext from the Spring ServletRequestAttributes's Principal.
The principal must support retrieval of the KeycloakSecurityContext, so at this point, only KeycloakPrincipal
values are supportedKeycloakSecurityContextpublic org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest httpRequest,
byte[] bytes,
org.springframework.http.client.ClientHttpRequestExecution clientHttpRequestExecution)
throws IOException
intercept in interface org.springframework.http.client.ClientHttpRequestInterceptorIOExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.