I found a tutorial about Spring REST Service OAuth on https://github.com/royclarkson/spring-rest-service-oauth
But I wonder how to configure client stored to database, so I can manage easily. In the tutorial client configuration store inMemory at class OAuth2ServerConfiguration.java
@Override
public void configure(ClientDetailsServiceConfigurer clients)
throws Exception {
// @formatter:off
clients.inMemory().withClient("clientapp")
.authorizedGrantTypes("password", "refresh_token")
.authorities("USER").scopes("read", "write")
.resourceIds(RESOURCE_ID).secret("123456");
// @formatter:on
}