title: How can I access custom claims added to token using jdbc token store in authorization server in resource server?
body: <p>I have added custom claims in token using TokenEnhancer, I need some of the custom claims to be available in Principal and/or authentication object.</p>
  
  <p>I am using JdbcTokenStore and not JwtTokenStore.</p>
  
  <p>I have gone through a couple of forum and articles but most talk about JwtTokenStore and not JdbcTokenStore.</p>
  
  <pre><code>public class AuthTokenEnhancer implements TokenEnhancer {
  
      @Override
      public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
  
          Map&lt;String, Object&gt; additionalInfo = new HashMap&lt;&gt;();
          additionalInfo.put("claim1", "claimVal");
          ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
          return accessToken;
      }
  
  }
  </code></pre>