title: From Keycloak Login : How can I get the Bearer Token from KEYCLOAK_IDENTITY/KC_RESTART cookie
body: <p>I have a UI application running on ReactJS. For login we are redirecting it to keycloak login page.</p>
  <ul>
  <li>After providing the username and password on keycloak login page,</li>
  <li>I am seeing that KEYCLOAK_IDENTITY/KC_RESTART are set.</li>
  <li>I have validated the KEYCLOAK_IDENTITY cookie at JWI.IO website as well. it is showing below details</li>
  </ul>
  <p>{
  &quot;cid&quot;: &quot;abc-client&quot;,
  &quot;pty&quot;: &quot;openid-connect&quot;,
  &quot;ruri&quot;: &quot;https://10.10.10.10:3001/&quot;,
  &quot;act&quot;: &quot;AUTHENTICATE&quot;,
  &quot;notes&quot;: {
  &quot;scope&quot;: &quot;openid&quot;,
  &quot;iss&quot;: &quot;https://10.10.10.10:8445/auth/realms/abcrealm&quot;,
  &quot;response_type&quot;: &quot;code&quot;,
  &quot;redirect_uri&quot;: &quot;https://10.10.10.10:3001/&quot;,
  &quot;state&quot;: &quot;879b6182-dca0-495c-8644-5b2ac032b5e4&quot;,
  &quot;nonce&quot;: &quot;1e263181-2313-45ea-962a-175fd58c6d75&quot;,
  &quot;response_mode&quot;: &quot;fragment&quot;
  }
  }</p>
  <ul>
  <li>Now My question is: how can I get the bearer token from this &quot;KEYCLOAK_IDENTITY&quot; cookie. I need the bearer token for all my next authorization checks on REST APIs because every user has different roles and can perform operations only if their profile has certain roles.</li>
  </ul>
  <p>In other words, I just want to do a check/validate that provided KEYCLOAK_IDENTITY token is having a valid roles in the profile or not.</p>