<div dir="ltr">The token is indeed updated automatically when it is requested. I was rather wondering if there was a way to not have to request it prior to each AJAX request. Currently, since the application does not know when the token expires, it has to either get it prior to each AJAX request, or try to use a possibly stale token and request it again when it gets a 401 from the REST service. It would be nice to get information about token expiry together with the token in response to k_query_bearer_token request.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 3:11 PM, Bill Burke <span dir="ltr">&lt;<a href="mailto:bburke@redhat.com" target="_blank">bburke@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">IIRC, if you&#39;re using the correct APIs (in Javascript or on the server<br>
side), the token will be automatically updated for you when you request it.<br>
<div><div class="h5"><br>
On 1/7/2015 4:06 AM, Hubert Przybysz wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; My jee web application uses its bearer token when issuing AJAX requests<br>
&gt; to other REST services within the realm (but at different origins). It<br>
&gt; does it by reading the exposed bearer token prior to making an AJAX<br>
&gt; request. Is there a mechanism by which the application may find out when<br>
&gt; the bearer token is refreshed, to make it possible to read the bearer<br>
&gt; token only when needed ?<br>
&gt;<br>
&gt; Br / Hubert.<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; keycloak-user mailing list<br>
&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Bill Burke<br>
JBoss, a division of Red Hat<br>
<a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</font></span></blockquote></div><br></div>