IdpAdapterException: Unable to parse the WebAuthResponse from the HTTP request


I'm having trouble configuring Auth0 as an Identity Provider.

Context: We are embedding the Perspective pages in our company web app, which is also secured with Auth0. To enable SSO and prevent any cross-site issues, the web app, Perspective and Auth0 are all served from the same top-level domain. E.g.:

  • Web app:
  • Perspective:
  • Auth0:

IdP setup: The settings were imported using the .well-known/openid-configuration endpoint. After the import, I updated the Authorization URL, Token URL and Issuer to use the custom domain ( instead of the default auth0 domain.

Problem: When performing a Test login for the first time (or after waiting for a while), it fails with the following exceptions in the logs (see full stacktrace below):

  • Unable to handle login response
  • com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapterException: Unable to parse the WebAuthResponse from the HTTP request
  • Caused by: com.inductiveautomation.ignition.gateway.auth.web.strategy.WebAuthStrategyException: Unable to exchange the auth code for the token
  • Caused by: com.inductiveautomation.ignition.gateway.auth.oidc.client.service.OIDCClientServiceException: Unable to execute HTTP request
  • Caused by: Read timed out

However, when I start another Test Login right after the first attempt, everything works as expected. The token is returned and I can perfectly map user attributes. The iss claim in the token corresponds to

What could be the cause for the timeout on the first login?

Full stacktrace from logs:

com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapterException: Unable to parse the WebAuthResponse from the HTTP request
at com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapter.parseAttributes(
at com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionImpl.onLoginResponseInternal(
at com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionImpl.lambda$onLoginResponse$2(
at com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionImpl.mdc(
at com.inductiveautomation.ignition.gateway.auth.idp.WebAuthSessionImpl.onLoginResponse(
at com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapterConfigRoutes$TestLoginWebAuthResponseHandler.handle(
at com.inductiveautomation.ignition.gateway.auth.federation.FederationRoutes.callback(
at com.inductiveautomation.ignition.gateway.auth.federation.FederationRoutes$CrossSiteRouteHandler.handle(
at com.inductiveautomation.ignition.gateway.dataroutes.Route.service(
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupImpl.service(
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupCollectionServlet.serviceInternal(
at com.inductiveautomation.ignition.gateway.dataroutes.AbstractRouteGroupServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
at org.eclipse.jetty.server.handler.HandlerList.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(
at org.eclipse.jetty.server.HttpChannel.dispatch(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$
at java.base/ Source)
Caused by: com.inductiveautomation.ignition.gateway.auth.web.strategy.WebAuthStrategyException: Unable to exchange the auth code for the token
at com.inductiveautomation.ignition.gateway.auth.web.strategy.oidc.OIDCWebAuthStrategy.parseWebAuthResponse(
at com.inductiveautomation.ignition.gateway.auth.idp.IdpAdapter.parseAttributes(
... 52 common frames omitted
Caused by: com.inductiveautomation.ignition.gateway.auth.oidc.client.service.OIDCClientServiceException: Unable to execute HTTP request
at com.inductiveautomation.ignition.gateway.auth.oidc.client.service.HttpOIDCClientService.doGetToken(
at com.inductiveautomation.ignition.gateway.auth.oidc.client.service.HttpOIDCClientService.getToken(
at com.inductiveautomation.ignition.gateway.auth.web.strategy.oidc.OIDCWebAuthStrategy.parseWebAuthResponse(
... 53 common frames omitted
Caused by: Read timed out
at java.base/ Method)
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at java.base/ Source)
at java.base/$ Source)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(
at org.apache.http.protocol.HttpRequestExecutor.execute(
at org.apache.http.impl.execchain.MainClientExec.execute(
at org.apache.http.impl.execchain.ProtocolExec.execute(
at org.apache.http.impl.execchain.RetryExec.execute(
at org.apache.http.impl.execchain.RedirectExec.execute(
at org.apache.http.impl.client.InternalHttpClient.doExecute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at com.inductiveautomation.ignition.gateway.auth.oidc.client.service.HttpOIDCClientService.doGetToken(
... 55 common frames omitted
1 Like

Is there any middleware such as a NAT or firewall which might be evicting idle TCP connections silently after a some timeout period? We've seen this issue before, and we introduced a few new system properties to help alleviate this issue (docs).

For example: in the past, we had a customer deploy Ignition in AWS. The Ignition instance connected to Auth0 over the Internet through the AWS NAT Gateway. After logging in a few times in a short period of time, if no other logins occur for 350 seconds, the AWS NAT Gateway would close its end of the TCP connection without Ignition being aware until the next time a user tried to login (say 450 seconds later). The stack trace matched what you posted.

1 Like

Actually, the stack trace was similar but the root cause was either "Connection Reset" or "Broken Pipe" instead of "Read timed out". Still look into what I mentioned above, but you may have other network issues as well (perhaps a slow or choppy connection?).

1 Like

Thanks for the pointers @jspecht. I've set the following values:

# ignition.conf

# /etc/sysctl.conf
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 5

Do these seem like sensible settings to you? Using these settings, the first-time test login does seem to be fixed, and the SSO seems to work better as well.

I can't speak to whether or not the proxy setting is appropriate for you. That depends on whether or not you need Ignition to connect to your IdP through a proxy.

As you have it now, Ignition will check if your connections to the IdP are idle every 60 seconds. The connection is considered idle if it has not sent or received data in the past 300 seconds. So in the worst case Ignition might try to use a connection which has been idle for ~360 seconds. Do you have any middleware which evicts connections idle for less than that amount of time? If so, you may want to decrease one or both of those values...

You also enabled keepalive on the TCP sockets Ignition create which connect to the IdP (socket.keepalive=true). Looks like every 600 seconds your OS will send a keepalive packet on those sockets. If it doesn't receive a keepalive packet in response after 60 seconds, it will try sending another keepalive packet. It will attempt to send a max of 5 consecutive unanswered keepalive packets before giving up.

If Ignition will evict connections after 300-360 seconds of inactivity, why have the keepalive packets enabled? If you'd rather keep the connection alive and avoid Ignition evicting them, alter your keepalive time to be less than your maxIdleConnectionTime + idleConnectionCheckInterval. Usually customers rely on the socket keepalive mechanism or the idle connection eviction mechanism but not both, though that's not to say the two can't play together. You have to find what works best for you.

1 Like

Hi @Frosty,

Dis this settings helps you to resolve above issue or have you done extra settings. Facing the same issue

@jspecht @Frosty
Adding more inputs from @Sourabh_Ambildhuke

We are facing the same issue, PFA screenshots and please let us know if this is resolved from your end.

Hi @Sourabh_Ambildhuke, a bit late to the party but for us this resolved the issues yes. Another configuration change that we made earlier was enabling or disabling (I'm not sure) same site cookies somewhere in the Gateway Configuration File (Gateway Configuration File Reference - Ignition User Manual 8.1 - Ignition Documentation).