title: Keycloak check permissions via Authzclient
body: <p>i'm trying to check user permissions from a keycloak server via the keycloak authzclient. But failing constantly, by now i'm not sure if i have some misconceptions about the process.</p>
  
  <pre><code>AuthzClient authzClient = AuthzClient.create();
  String eat = authzClient.obtainAccessToken("tim", "test123").getToken();
  
  AuthorizationResource resource = authzClient.authorization(eat);
  
  PermissionRequest request = new PermissionRequest();
  request.setResourceSetName("testresource");
  
  String ticket = authzClient.protection().permission().forResource(request).getTicket();
  AuthorizationResponse authResponse = resource.authorize(new AuthorizationRequest(ticket));
  
  System.out.println(authResponse.getRpt());
  </code></pre>
  
  <p>The last call authResponse.getRpt() fails with a 403 forbidden. 
  But the following settings in the admin console evaluates to Permit?</p>
  
  <p><a href="https://i.stack.imgur.com/lnk0J.png" rel="noreferrer">keycloak evaluation setting</a></p>
  
  <p>The Client config is:</p>
  
  <pre><code>{
    "realm": "testrealm",
    "auth-server-url": "http://localhost:8080/auth",
    "ssl-required": "external",
    "resource": "tv",
    "credentials": {
      "secret": "d0c436f7-ed19-483f-ac84-e3b73b6354f0"
    },
    "use-resource-role-mappings": true
  }
  </code></pre>
  
  <p>The following code: </p>
  
  <pre><code>AuthzClient authzClient = AuthzClient.create();
  String eat = authzClient.obtainAccessToken("tim", "test123").getToken();
  
  EntitlementResponse response = authzClient.entitlement(eat).getAll("tv");
  String rpt = response.getRpt();
  
  TokenIntrospectionResponse requestingPartyToken = authzClient.protection().introspectRequestingPartyToken(rpt);
      if (requestingPartyToken.getActive()) {
          for (Permission granted : requestingPartyToken.getPermissions()) {
  
              System.out.println(granted.getResourceSetId()+" "+granted.getResourceSetName()+" "+granted.getScopes());
          }
      }
  </code></pre>
  
  <p>Just gives me the "default resource"</p>
  
  <pre><code>7d0f10d6-6f65-4866-816b-3dc5772fc465 Default Resource []
  </code></pre>
  
  <p>But even when i put this Default Resource in the first code snippet </p>
  
  <pre><code>...
  PermissionRequest request = new PermissionRequest();
  request.setResourceSetName("Default Resource");
  ... 
  </code></pre>
  
  <p>it fives me a 403 . Where am I wrong?</p>
  
  <p>Kind regards</p>
  
  <p>Keycloak Server is 3.2.1.Final.
  keycloak-authz-client is 3.2.0.Final. </p>