Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
in KerberosAuthenticator.doSpnegoSequence(..) following line of code will just create a principal of the form "HTTP/<host>",
String servicePrincipal = KerberosUtil.getServicePrincipal("HTTP", KerberosAuthenticator.this.url.getHost());
but uri.getHost() is not sure of always getting hostname. If uri contains IP, then it just returns IP.
For SPNEGO authentication principal should always be created with <hostname>.
This code should be something like this, which will look /etc/hosts to get hostname
String hostname = InetAddress.getByName( KerberosAuthenticator.this.url.getHost()).getHostName(); String servicePrincipal = KerberosUtil.getServicePrincipal("HTTP", hostname);