title: How to configure Spring Security OAuth 2.0 client store to database
body: <p>I found a tutorial about Spring REST Service OAuth on <a href="https://github.com/royclarkson/spring-rest-service-oauth" rel="noreferrer">https://github.com/royclarkson/spring-rest-service-oauth</a></p>
  
  <p>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</p>
  
  <pre class="lang-java prettyprint-override"><code>    @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
      }
  </code></pre>