title: How to attach UserDetails to Principal received from JWT token using Spring Oauth2
body: <p>I have these services</p>
  
  <ul>
  <li>oauth2 authentication server that uses JDBC provider (DB-1)</li>
  <li>Zuul-enabled web application that proxies requests to authserver and resource server </li>
  <li>resource that enables @EnableOauth2Resource (DB-2)</li>
  </ul>
  
  <p>I need to fetch the User Details in resource server from DB-2 using credentials received from DB-1 and set enabled authorities to the current Principal for further using with @PreAuthorize of @RolesAllowed annotations.</p>
  
  <p>Are there some hook to replace or update org.springframework.security.oauth2.provider.OAuth2Authentication after successful authentication using oauth2 token?</p>