2

According to JSON Vulnerability Protection I prefix JSON responses:

@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
    MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
    converter.setJsonPrefix(")]}',\n");
    return converter;
}

It works fine with AngularJS, but not with @EnableOAuth2Resource-App, because Jackson can't parse response from Authorization Server. Firthermore, I can't override

    @Bean
    public TokenStore jwtTokenStore() {
        return new JwtTokenStore(jwtTokenEnhancer());
    }

definition from org.springframework.cloud.security.oauth2.resource.ResourceServerTokenServicesConfiguration.JwtTokenServicesConfiguration to configure ObjectMapper/RestTemplate because of autoconfiguration ordering and SPR-13980.

Maybe I'm missing a solution?

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
Anton Bessonov
  • 9,208
  • 3
  • 35
  • 38

0 Answers0