title: Implementing Authorization using keycloak, after extracting the RPT token how to map the Resource Name with the controllers and unauthorize a user
body: <p>I am working on a Play Framework Rest API, which uses keycloak for authentication and now on extending towards the authorization, i have extracted the RPT token and stored the permission access based on resource name. But now i have no idea how to map my controllers with the resource name and restrict the user to use certain functions which can only be used by admin or a different role. The structure of permission is:</p>
  
  <pre><code>"authorization": {
      "permissions": [
        {
          "rsid": "4bxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxx",
          "rsname": "Default Resource"
        },
        {
          "rsid": "8xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxx",
          "rsname": "admin_res"
        },
        {
          "rsid": "cxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxx",
          "rsname": "superAdmin_res"
        }
      ]
    }, 
  </code></pre>
  
  <p>And i am storing all the rsname in a list and stored locally in the session.</p>
  
  <p>Now i just want to control the api calls based on resource name and restricting the controller calls.</p>
  
  <p>I have a KeyCloakSessionAction which extends to a action.simple, so how can i pass the auth details along with it and restrict certain controllers.</p>