<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><span class="message_body">Hi,<br>
I am working on a NodeJS Express application using bearer only authentication with Keycloak. It contains a REST API for use by other applications.</span></p>
<p><br>
<span class="message_body"></span></p>
<p><span class="message_body">Up until now I have been using&nbsp;the Keycloak Connect middleware to secure my POST method, which&nbsp;is a&nbsp;great solution for&nbsp;basic authentication as&nbsp;is&nbsp;almost completely&nbsp;takes it out of the hands of the developer. However, now I need
 to be able to get a token directly and keep it for a given duration, say 15 minutes, for use by multiple connecting clients.<br>
</span></p>
<p><br>
</p>
<p>This token will be used by multiple applications connecting via this REST API, possibly in very quick succession. It needs to be possible to verify that the token is still valid synchronously on the fly, renewing it if required. Is there anything perhaps
 in the &quot;keycloak-auth-utils&quot; npm package which can get used to handle this? Or any other existing libraries?</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Addam.<br>
</p>
</body>
</html>