Class RestTemplateInterceptor
- java.lang.Object
-
- io.mosip.kernel.auth.defaultadapter.config.RestTemplateInterceptor
-
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
@Component public class RestTemplateInterceptor extends Object implements org.springframework.http.client.ClientHttpRequestInterceptor
It is used to intercept any http calls made using rest template from this application. CONFIG: This is added to the list of interceptors in the RestTemplate bean created in the SecurityConfig. TASKS: 1. Intercept all the requests from the application and do the below tasks. 2. Intercept a request to add auth token to the "Authorization" header. 3. Intercept a response to modify the stored token with the "Authorization" header of the response.- Since:
- 1.0.0
- Author:
- Sabbu Uday Kumar, Ramadurai Saravana Pandian, Raj Jha
-
-
Constructor Summary
Constructors Constructor Description RestTemplateInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest httpRequest, byte[] bytes, org.springframework.http.client.ClientHttpRequestExecution clientHttpRequestExecution)
-
-
-
Method Detail
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest httpRequest, byte[] bytes, org.springframework.http.client.ClientHttpRequestExecution clientHttpRequestExecution) throws IOException- Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-
-