You received the token from the auth server. Now you can use this token to make another request to the auth server to retrieve the user object. This json object will contain roles (permissions). The request will look as follows.
curl -H "Authorization: Bearer 2a953581-e9c9-4278-b42e-8af925f49a99" http:
To do this, you need to create an end user endpoint and implement UserDetailsService.
@RequestMapping("/user") public Principal user(Principal user) { return user; } @Bean UserDetailsService userDetailsService.....
The role list is created and set in the org.springframework.security.core.userdetails file in UserDetailsService.User as follows.
AuthorityUtils.createAuthorityList("ROLE_USER", "ROLE_ADMIN"));
source share