Extract Currently Logged in User information from JWT token using Spring Security : <p>I have implemented JWT and LDAP Authentication using Spring Security Oauth2. It seems to be working fine and I can login with my LDAP credentials. </p>

<p>Now, there is one requirement that I need to use the currently logged in user info to save details in database - specifically like when that user add/update a new record. I tried to get that using Spring security way using </p>

<pre><code>SecurityContextHolder.getContext().getAuthentication().getDetails() 
</code></pre>

<p>but it doesn't return all that information which I have in JWT. It just returns Remote IP,the JWT token value and authenticated true. It doesn't even return name().</p>

<p>I am new to JWT, so not sure if I need to extract it by reading that token and even how we can achieve it.</p>

<p>Any pointers will be appreciated.</p>

<p>Thanks.</p>
