title: How to get Requesting Party Token (RPT) by API in Keycloak?
body: <p>I am to struggling to find it but I can't find a solution. Does anyone help me?</p>
  <p>Here is my try.
  #1 First find PAT (Protection API Token)
  <a href="https://i.stack.imgur.com/JyrDB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JyrDB.png" alt="enter image description here" /></a></p>
  <p>#2 get the permission ticket list
  <a href="https://i.stack.imgur.com/iIZS2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iIZS2.png" alt="enter image description here" /></a></p>
  <p>#3 try get RPT but got &quot;Ticket verification failed&quot; error.
  <a href="https://i.stack.imgur.com/pMP1x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pMP1x.png" alt="enter image description here" /></a></p>
  <p>#4 This source code for this error but I am not familiar with the source.</p>
  <pre><code>    private PermissionTicketToken verifyPermissionTicket(KeycloakAuthorizationRequest request) {
          String ticketString = request.getTicket();
  
          PermissionTicketToken ticket = request.getKeycloakSession().tokens().decode(ticketString, PermissionTicketToken.class);
          if (ticket == null) {
              throw new CorsErrorResponseException(request.getCors(), &quot;invalid_ticket&quot;, &quot;Ticket verification failed&quot;, Status.FORBIDDEN);
          }
  </code></pre>
  <p>It copy from source file(AuthorizationTokenService.java) on line 670.
  <a href="https://i.stack.imgur.com/SuFiX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SuFiX.png" alt="enter image description here" /></a></p>
  <p><a href="https://www.keycloak.org/docs/latest/authorization_services/#_service_overview" rel="nofollow noreferrer">https://www.keycloak.org/docs/latest/authorization_services/#_service_overview</a></p>