Spring Security OAuth2 Plugin with Json Tokens

0

Can anyone tell me if Spring Security's OAuth2 plugin supports access tokens in JSON format instead of XML format? And if so, what do we have to do to make this change?

    
asked by anonymous 21.02.2014 / 20:59

1 answer

1

Yes, he accepts. By default it already returns a JSON. In some newer versions of Spring OAuth2 it requires you to set a return pattern in Spring. It depends a lot on the Spring Framework version and Spring Security OAuth2.

The default setting I have now, using java, config is:

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.ignoreAcceptHeader(true)
                    .defaultContentType(MediaType.APPLICATION_JSON);
}
    
15.05.2014 / 01:30