Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9019

KerberosAuthenticator.doSpnegoSequence(..) should create a HTTP principal with hostname everytime

    XMLWordPrintableJSON

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);

      Attachments

        Activity

          People

            Unassigned Unassigned
            vinayakumarb Vinayakumar B
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: