If I use the client authentication scheme header (default) with a client id and client secret i allways get a "Bad client credentials" error. If i set the client authentication scheme to query then the same configuration works.
This sounds like a bug to me. I use 1.0.0.RC3
Tested with the following conifguration:
Server config:Code:@Bean(name = "publicRestTemplate") public OAuth2RestTemplate createOauthRestTemplate() { ClientCredentialsResourceDetails rd = new ClientCredentialsResourceDetails(); rd.setAccessTokenUri("http://localhost:8080/myapp/oauth/token"); rd.setClientId("myapp-application"); rd.setClientSecret("ApplicationSecret"); rd.setGrantType("client_credentials"); rd.setClientAuthenticationScheme(AuthenticationScheme.query); //rd.setClientAuthenticationScheme(AuthenticationScheme.header); Remark: not working OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(rd); List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); messageConverters.add(new MappingJacksonHttpMessageConverter()); oAuth2RestTemplate.setMessageConverters(messageConverters); return oAuth2RestTemplate; }
Or is there any missconfiguration?Code:<bean id="clientDetailsUserService" class="org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService"> <constructor-arg ref="clientDetails" /> </bean> <oauth:client-details-service id="clientDetails"> <oauth:client client-id="myapp-application" authorized-grant-types="authorization_code,client_credentials" secret="ApplicationSecret" authorities="ROLE_USER" /> </oauth:client-details-service>


Reply With Quote
