title: How to extract additional infomation from Json Web Token JWT
body: <p>I'm working in a project apply Spring boot and JWT.
  In OAuth2 configuration, I added more information into JWT sucessfully but I don't know how to extract this information when process a request contained my information.</p>
  
  <p>Below is the code segment with I added my additional information:</p>
  
  <pre><code>public class CustomTokenEnhancer implements TokenEnhancer {
  
      @Override
      public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
          Map&lt;String, Object&gt; additionalInfo = new HashMap&lt;&gt;();
          additionalInfo.put("user_name", authentication.getName());
          User user = userService().getUserDetailsByLoginId(authentication.getName());
          additionalInfo.put("user_id", user.getRelationPartId());
          ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
          return accessToken;
      }
  }
  </code></pre>
  
  <p>If you had experienced on it, please help me to get user_id from my token when process a request.</p>
  
  <p>Thanks</p>