"IOException" while using JWT authentication with EJB over HTTP protocol

Solution Unverified - Updated -

Issue

While using JWT authentication with EJB invocations on EAP 7.1+, the EJB calls succeed if we use remote+http protocol, however when switching to http protocol following this article, below error is reported on EJB client side:

Exception in thread "main" javax.ejb.EJBException: java.io.IOException: WFHTTP000005: Invalid response code 401 (full response ClientResponse{responseHeaders={www-authenticate=[Bearer realm="jwt-realm"], content-length=[77], content-type=[text/html], date=[Fri, 11 Oct 2019 13:54:46 GMT]}, responseCode=401, status='', protocol=HTTP/2.0})
        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:221)
        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:125)
        at com.sun.proxy.$Proxy11.getSecurityInfo(Unknown Source)
        at client.FatClient.doTestAuth(FatClient.java:78)
        at client.FatClient.main(FatClient.java:48)
Caused by: java.io.IOException: WFHTTP000005: Invalid response code 401 (full response ClientResponse{responseHeaders={www-authenticate=[Bearer realm="jwt-realm"], content-length=[77], content-type=[text/html], date=[Fri, 11 Oct 2019 13:54:46 GMT]}, responseCode=401, status='', protocol=HTTP/2.0})
        at org.wildfly.httpclient.common.HttpTargetContext$1$1.lambda$completed$4(HttpTargetContext.java:222)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.1+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content