[keycloak-user] Making it work with ZeroConf/Bonjour/Avahi addresses
Brandon
brandonesbox at gmail.com
Tue Apr 16 12:41:27 EDT 2019
I’m using KeyCloak to handle authentication for an application served over
LAN at my office. The application is accessible at office-1.local using
ZeroConf <https://en.wikipedia.org/wiki/Zero-configuration_networking>
(it’s a Linux server, so it’s configured using Avahi).
There is at least the problem that, after logging in with KeyCloak, one
winds up in a redirect loop due to the following error:
2019-04-16 16:37:14.587 ERROR 1 --- [ XNIO-2 task-31]
o.k.adapters.OAuthRequestAuthenticator : failed to turn code into
token
java.net.UnknownHostException: ces-oficina.local
at java.net.InetAddress.getAllByName0(InetAddress.java:1281)
~[na:1.8.0_181]
at java.net.InetAddress.getAllByName(InetAddress.java:1193)
~[na:1.8.0_181]
at java.net.InetAddress.getAllByName(InetAddress.java:1127)
~[na:1.8.0_181]
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
~[httpclient-4.5.5.jar!/:4.5.5]
at org.keycloak.adapters.ServerRequest.invokeAccessCodeToToken(ServerRequest.java:111)
~[keycloak-adapter-core-4.7.0.Final.jar!/:4.7.0.Final]
...
So it seems like org.apache.http.impl.conn.SystemDefaultDnsResolver doesn’t
understand ZeroConf. Can it be configured so that KeyCloak can be used with
ZeroConf?
Thanks,
Brandon
More information about the keycloak-user
mailing list