Skip to content

Commit

Permalink
feat: remove RestTemplate interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Jan 25, 2024
1 parent 025e77f commit dfada99
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,4 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
protected SecurityFilterChain filterPublicUrlsChain(HttpSecurity http, ApplicationProperties applicationProperties) throws Exception {
return publicSecurityFilterChainConfiguration.buildSecurityPublicFilterChain(http, applicationProperties.publicUrls());
}

@Bean
protected RestTemplate restTemplateQueen() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getInterceptors().add(new RestTemplateAddJsonHeaderInterceptor());
return restTemplate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,4 @@ Converter<Jwt, Collection<GrantedAuthority>> jwtGrantedAuthoritiesConverter(Oidc
return new GrantedAuthorityConverter(oidcProperties, roleProperties);
}

@Bean
protected RestTemplate restTemplateQueen(AuthenticationHelper authenticationHelper) {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getInterceptors().add(new RestTemplateAddJsonHeaderInterceptor());
restTemplate.getInterceptors().add(new RestTemplateTokenInterceptor(authenticationHelper));
return restTemplate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.io.IOException;

/**
* Add interceptor to restTemplate to inject tokens when oidc is enabled
* ToDo, change this to create intercept for WebClient
*/
@RequiredArgsConstructor
public class RestTemplateTokenInterceptor implements ClientHttpRequestInterceptor {
Expand Down

0 comments on commit dfada99

Please sign in to comment.