Accessing JWT Token from a Spring Boot Rest Controller
问题 I am implementing a REST API with Spring Boot and I am securing it with JWT and Oauth 2. I have no problems with authentication and producing an access token. When a user makes a request I want to access its JWT token from the controller. @RequestMapping(value = "/users", method = RequestMethod.GET) public List<AppUser> getUsers(OAuth2Authentication auth) { logger.info("CREDENTIALS:" + auth.getCredentials().toString()); logger.info("PRINCIPAL:" + auth.getPrincipal().toString()); logger.info(