title: I'm very new to the spring security and OAuth2
body: <p>Hi I'm very new to Spring Security and OAUTH2 can any one help .... I'm using the example provided in this example <a href="http://www.beingjavaguys.com/2014/10/spring-security-oauth2-integration.html" rel="nofollow">http://www.beingjavaguys.com/2014/10/spring-security-oauth2-integration.html</a></p>
  
  <p>What I'm trying to do is create 2 web applications where one app(mainApp) stores all the protected resources and does not know about the users and it needs to make a rest call to another app to get the details</p>
  
  <p>Currently in my security config </p>
  
  <pre><code>&lt;authentication-manager id="clientAuthenticationManager"
          xmlns="http://www.springframework.org/schema/security"&gt;
          &lt;authentication-provider user-service-ref="clientDetailsUserService" /&gt;
      &lt;/authentication-manager&gt;
  
      &lt;authentication-manager alias="authenticationManager"
          xmlns="http://www.springframework.org/schema/security"&gt;
          &lt;authentication-provider&gt;
              &lt;user-service&gt;
                  &lt;user name="abcd" password="1234" authorities="ROLE_APP" /&gt;
              &lt;/user-service&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>In my case, I want to let our custom API which is in another app  do the authentication, then return a custom UserDetails object containing  the roles and other attributes</p>