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 supportedKeycloakSecurityContext
public 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.ClientHttpRequestInterceptor
IOException
Copyright © 2018 JBoss by Red Hat. All rights reserved.