title: Logout user via Keycloak REST API doesn't work
body: <p>I have issue while calling Keycloak's <strong>logout</strong> endpoint from an (mobile) application. </p>
  
  <p>This scenario is supported as stated in <a href="http://www.keycloak.org/docs/latest/securing_apps/topics/oidc/oidc-generic.html" rel="noreferrer">its documentation</a>:</p>
  
  <blockquote>
    <p>/realms/{realm-name}/protocol/openid-connect/logout</p>
    
    <p>The logout endpoint logs out the authenticated user.</p>
    
    <p>The user agent can be redirected to the endpoint, in which case the active user session is logged out. Afterward the user agent is redirected back to the application.</p>
    
    <p><strong>The endpoint can also be invoked directly by the application. To invoke this endpoint directly the refresh token needs to be included as well as the credentials required to authenticate the client</strong>.</p>
  </blockquote>
  
  <p>My request has following format:</p>
  
  <pre><code>POST http://localhost:8080/auth/realms/&lt;my_realm&gt;/protocol/openid-connect/logout
  Authorization: Bearer &lt;access_token&gt;
  Content-Type: application/x-www-form-urlencoded
  
  refresh_token=&lt;refresh_token&gt;
  </code></pre>
  
  <p>but this error always occurs:</p>
  
  <pre><code>HTTP/1.1 400 Bad Request
  Connection: keep-alive
  X-Powered-By: Undertow/1
  Server: WildFly/10
  Content-Type: application/json
  Content-Length: 123
  Date: Wed, 11 Oct 2017 12:47:08 GMT
  
  {
    "error": "unauthorized_client",
    "error_description": "UNKNOWN_CLIENT: Client was not identified by any client authenticator"
  }
  </code></pre>
  
  <p>It seems that Keycloak is unable to detect the current client's identity event if I've provided <strong>access_token</strong>. I've the used same <strong>access_token</strong> to access other Keycloak's APIs without any problems, like <strong>userinfo</strong>
   (<em>/auth/realms//protocol/openid-connect/userinfo</em>). </p>
  
  <p>My request was based on this <a href="https://issues.jboss.org/browse/KEYCLOAK-2476" rel="noreferrer">Keycloak's issue</a>. The author of the issue got it worked but it is not my case. </p>
  
  <p>I'm using Keycloak <strong>3.2.1.Final</strong>.  </p>
  
  <p>Do you have that same problem? Have you got any idea how to solve it?</p>