Spring OAuth/JWT get extra information from access token
<p>I made a simple application that use spring security with oauth/jwt provider.
I added extra information in jwt token by custom JwtAccessTokenConverter and it works well.</p>

<p><strong>My issue is how gets these extra informations in my Rest Controller.</strong></p>

<p>This is my test:</p>

<pre><code>@RequestMapping(value = "/test", produces = { "application/json" },method = RequestMethod.GET) 
public String testMethod(OAuth2Authentication authentication,
        OAuth2AccessToken token,
Principal user){
.....
Object a=token.getAdditionalInformation();
Object b=token.getValue();
...
}
</code></pre>

<p>The results are:</p>

<ul>
<li>OAuth2Authentication: well inject but don't contain additional informations or accesstoken object (it contains only the original jwt token string).</li>
<li>User is a reference to OAuth2Authentication</li>
<li>OAuth2AccessToken: is aop proxy without any information infact object A and B are null.</li>
</ul>

<p>Some extra info:</p>

<ul>
<li>I checked,by debug, that ResourceService use my JwtAccessTokenConverter and extract the list of additional information from the access token string in input.</li>
</ul>