How to get scope and roles in Oauth2/2.1 spring boot resource server?
Authentication authentication = getAuthentication();
System.out.println(authentication.getAuthorities());
Authorities
returns only scope.
Here is my token introspect
{
"active": true,
"sub": "0f370b1e-e3a9-4ee3-a8a3-21bbb3437c16",
"aud": [
"1"
],
"nbf": 1679019352,
"scope": "read",
"roles": [
"user"
],
"iss": "http://3.6.239.198:9000",
"exp": 1679022352,
"iat": 1679019352,
"client_id": "1",
"token_type": "Bearer"
}
How to retrieve role
in the resource server?