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.
Now, there is one req
In your REST Service, add the OAuth2Authentication Class as an argument
@RequestMapping(value = "/{id}/products", method = RequestMethod.POST)
public ResourceResponse processProducts(OAuth2Authentication auth) {
Springboot will automatically map the logged-in user details to this object. Now, you can do the following to access the username
auth.getPrincipal().toString()