title: How to separate authorization server spring security in java
body: <p>I have started to learn spring security (Oauth2). I am having a REST API service which is protected by Spring Oauth2. What i want to do is, I want to separate authorization server and resource server,  For example, </p>
  
  <p>I am having
  Authorization:   <a href="http://server1:8080/RESTTest/oauth/token/grant_type=client_credentials&amp;client_id=clientt&amp;client_secret=secret" rel="nofollow">http://server1:8080/RESTTest/oauth/token/grant_type=client_credentials&amp;client_id=clientt&amp;client_secret=secret</a></p>
  
  <p>And 
  Resource 
  <a href="http://server1:8080/RESTTest/api/users/?access_token=2cf682c6-2900-47dc-a468-441fcee0dc18" rel="nofollow">http://server1:8080/RESTTest/api/users/?access_token=2cf682c6-2900-47dc-a468-441fcee0dc18</a></p>
  
  <p>What i want is, </p>
  
  <p>Authorization : <a href="http://Server1:8080/" rel="nofollow">http://Server1:8080/</a><strong>authorizationserver</strong> /oauth/token/grant_type=client_credentials&amp;client_id=clientt&amp;client_secret=secret</p>
  
  <p>Resource:
  <a href="http://server2:8080/" rel="nofollow">http://server2:8080/</a><strong>RESTTest</strong>/api/users/?access_token=2cf682c6-2900-47dc-a468-441fcee0dc18</p>
  
  <p>I am using <strong>JDBCTokenstore</strong>. I am not sure how to separate it. Can someone help me. </p>
  
  <p>Thanks, </p>