Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 71240200C7D for ; Mon, 1 May 2017 23:11:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6FE59160BAE; Mon, 1 May 2017 21:11:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B8B43160BA0 for ; Mon, 1 May 2017 23:11:10 +0200 (CEST) Received: (qmail 36541 invoked by uid 500); 1 May 2017 21:11:08 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 36512 invoked by uid 99); 1 May 2017 21:11:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 May 2017 21:11:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 966D7C075A for ; Mon, 1 May 2017 21:11:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id FEvDjsSTMkqX for ; Mon, 1 May 2017 21:11:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id CB7E45FB26 for ; Mon, 1 May 2017 21:11:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id ECA7EE092E for ; Mon, 1 May 2017 21:11:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2DA3A21DE3 for ; Mon, 1 May 2017 21:11:04 +0000 (UTC) Date: Mon, 1 May 2017 21:11:04 +0000 (UTC) From: "Hudson (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-20760) After pam setup- Hive View user home test fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 01 May 2017 21:11:11 -0000 [ https://issues.apache.org/jira/browse/AMBARI-20760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15991531#comment-15991531 ] Hudson commented on AMBARI-20760: --------------------------------- FAILURE: Integrated in Jenkins build Ambari-trunk-Commit #7399 (See [https://builds.apache.org/job/Ambari-trunk-Commit/7399/]) AMBARI-20760. After pam setup- Hive View user home test fails (Anita (rlevas: [http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=f167236c24501a0d14afccfbc53a2c648cb21731]) * (edit) ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProviderTest.java * (edit) ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariPamAuthenticationProvider.java > After pam setup- Hive View user home test fails > ----------------------------------------------- > > Key: AMBARI-20760 > URL: https://issues.apache.org/jira/browse/AMBARI-20760 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: trunk > Reporter: Anita Gnanamalar Jebaraj > Assignee: Anita Gnanamalar Jebaraj > Attachments: AMBARI-20760.patch, AMBARI-20760-updated.patch, error.PNG > > > After setting up PAM, tried to login as PAM user and access hive view, user home test fails with the error as in screen shot. > This issue was pointed out by [~hkropp] in the jira AMBARI-12263, but was not incorporated in the code. Pasting the comment from Henning below. > Something we noticed is that in a secured cluster we have issues with the views, getting the following exception for the Hive view as an example: > Struct:TOpenSessionResp(status:TStatus(statusCode:ERROR_STATUS, infoMessages:[*org.apache.hive.service.cli.HiveSQLException:Failed to validate proxy privilege of ambari for org.apache.ambari.server.security.authorization.AmbariPamAuthenticationProvider$1@34511119:33:32, > ..... > sqlState:08S01, errorCode:0, errorMessage:Failed to validate proxy privilege of ambari for org.apache.ambari.server.security.authorization.AmbariPamAuthenticationProvider$1@34511119), serverProtocolVersion:null) > As you can see it tries to impersonte "org.apache.ambari.server.security.authorization.AmbariPamAuthenticationProvider$1@34511119:33:32". Changing the UsernamePasswordAuthenticationToken from Principal to username fixes this. > So instead of : > UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(principal, null, userAuthorities); > We use: > UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(user.getUserName(), null, userAuthorities); > What could potential also work is, overriding toString of the principal like: > Principal principal = new Principal() { > @Override > public String getName() { > return user.getUserName(); > } > @Override > public String toString(){ > return user.getUserName().toString(); > } > }; > We did not test this! > As a little side note, I notices you are using String concatenation in your error logging like this: LOG.error("Message"+ ex.getMessage()) I think the public void error(String msg, Throwable t); interface would be preferable in such scenarios, so: LOG.error("Message", ex) -- This message was sent by Atlassian JIRA (v6.3.15#6346)