title: Accessing keycloak roles / users attributes from Java API
body: <p>I've created a role and and a user in Keycloak and added one attribute in both of them; for example:</p>
  
  <pre><code>my_role_attr = 'x'
  my_user_attr = 'y'
  </code></pre>
  
  <p>Then I'm trying to access that info. via the JAVA KeycloakSecurityContext (and the associated AccessToken / IDToken). I can see the name of the roles and the user information but I cannot find those attributes.</p>
  
  <p>I understand that I've to creat a Protocol Mapper "User Attribute" to map the "my_user_attr" into a Token Claim. Then it's fine I can get the value in the AccessToken / IDToken.</p>
  
  <p>But I cannot find a way to get the role attribute. I do not see any "Protocol Mapper" for role attribute. Am I missing something.</p>