<div dir="ltr">The docs for security (<a href="http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#security">http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#security</a>) say:<div><br></div><div>&gt; Security within Undertow is implemented as a set of asynchronous handlers and a set of authentication mechanisms co-ordinated by these handlers.<br></div><div><br></div><div>However, it appears that the IdentityManager and AuthenticationMechanism APIs are synchronous. For example, suppose I want to do simple username/password authentication using FormAuthenticationMechanism. That will use the IdentityManager on the SecurityContext to determine if the username/password is valid. For me that would require a database lookup and I&#39;d like to do that asynchronously. However, the IdentityManager.verify API requires an immediate response so I have to do a block database lookup. Since I&#39;ve been super careful to do everything in all my handlers async and have exactly 1 thread per core this seems like a significant stumbling block.</div><div><br></div><div>2 questions:</div><div><br></div><div>1. Is there a way to do something like I&#39;m describing in an async manner?</div><div>2. Why is security &quot;special&quot; using a SecurityContext, different APIs, etc. Couldn&#39;t it all have been implemented in terms of regular HttpHandler? That would make it the API smaller and make it possible to do async authentication.</div><div><br></div><div>Thanks,</div><div>Oliver</div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small"><div style="font-size:13px;line-height:19.5px">CTO, Analytic Spot</div><div style="font-size:13px;line-height:19.5px">44 West Broadway #222</div><div style="font-size:13px;line-height:19.5px">Eugene, OR 97401<br></div><div style="font-size:13px;line-height:19.5px"><a href="http://analyticspot.com/" style="z-index: 0;">analyticspot.com</a> <span style="color:rgb(127,127,127);font-family:&#39;helvetica neue&#39;;font-size:11px;line-height:normal">• </span>425-296-6556</div></div><div style="font-size:small"><span style="line-height:19.5px"><a href="http://www.linkedin.com/in/oliverdain" style="z-index: 0;">www.linkedin.com/in/oliverdain</a></span></div></div></div>