Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9327410C4D for ; Wed, 5 Mar 2014 20:13:00 +0000 (UTC) Received: (qmail 96612 invoked by uid 500); 5 Mar 2014 20:12:52 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 96486 invoked by uid 500); 5 Mar 2014 20:12:49 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 96381 invoked by uid 99); 5 Mar 2014 20:12:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2014 20:12:46 +0000 Date: Wed, 5 Mar 2014 20:12:46 +0000 (UTC) From: "Suresh Srinivas (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-10078) KerberosAuthenticator always does SPNEGO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-10078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13921342#comment-13921342 ] Suresh Srinivas commented on HADOOP-10078: ------------------------------------------ [~tucu00], can you please take a look? > KerberosAuthenticator always does SPNEGO > ---------------------------------------- > > Key: HADOOP-10078 > URL: https://issues.apache.org/jira/browse/HADOOP-10078 > Project: Hadoop Common > Issue Type: Bug > Components: security > Affects Versions: 2.0.3-alpha > Reporter: Robert Kanter > Assignee: Robert Kanter > Priority: Minor > Fix For: 2.3.0 > > Attachments: HADOOP-10078.patch > > > HADOOP-8883 made this change to {{KerberosAuthenticator}} > {code:java} > @@ -158,7 +158,7 @@ public class KerberosAuthenticator implements Authenticator { > conn.setRequestMethod(AUTH_HTTP_METHOD); > conn.connect(); > > - if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { > + if (conn.getRequestProperty(AUTHORIZATION) != null && conn.getResponseCode() == HttpURLConnection.HTTP_OK) { > LOG.debug("JDK performed authentication on our behalf."); > // If the JDK already did the SPNEGO back-and-forth for > // us, just pull out the token. > {code} > to fix OOZIE-1010. However, as [~aklochkov] pointed out recently, this inadvertently made the if statement always false because it turns out that the JDK excludes some headers, including the "Authorization" one that we're checking (see discussion [here|https://issues.apache.org/jira/browse/HADOOP-8883?focusedCommentId=13807596&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13807596]). This means that it was always either calling {{doSpnegoSequence(token);}} or {{getFallBackAuthenticator().authenticate(url, token);}}, which is actually the old behavior that existed before HADOOP-8855 changed it in the first place. > In any case, I tried removing the "Authorization" check and Oozie still works with and without Kerberos; the NPE reported in OOZIE-1010 has since been properly fixed due as a side effect for a similar issue in OOZIE-1368. -- This message was sent by Atlassian JIRA (v6.2#6252)