Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72A3910E4F for ; Thu, 13 Feb 2014 01:14:34 +0000 (UTC) Received: (qmail 96422 invoked by uid 500); 13 Feb 2014 01:14:21 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 96348 invoked by uid 500); 13 Feb 2014 01:14:19 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 96317 invoked by uid 99); 13 Feb 2014 01:14:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Feb 2014 01:14:19 +0000 Date: Thu, 13 Feb 2014 01:14:19 +0000 (UTC) From: "Larry McCay (JIRA)" To: common-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HADOOP-10342) Extend UserGroupInformation to return a UGI given a preauthenticated kerberos Subject MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Larry McCay created HADOOP-10342: ------------------------------------ Summary: Extend UserGroupInformation to return a UGI given a preauthenticated kerberos Subject Key: HADOOP-10342 URL: https://issues.apache.org/jira/browse/HADOOP-10342 Project: Hadoop Common Issue Type: Bug Components: security Reporter: Larry McCay Assignee: Larry McCay We need the ability to use a Subject that was created inside an embedding application through a kerberos authentication. For example, an application that uses JAAS to authenticate to a KDC should be able to provide the resulting Subject and get a UGI instance to call doAs on. Example: {code} UserGroupInformation.setConfiguration(conf); LoginContext context = new LoginContext("com.sun.security.jgss.login", new UserNamePasswordCallbackHandler(userName, password)); context.login(); Subject subject = context.getSubject(); final UserGroupInformation ugi2 = UserGroupInformation.getUGIFromSubject(subject); ugi2.doAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { final FileSystem fs = FileSystem.get(conf); int i=0; for (FileStatus status : fs.listStatus(new Path("/user"))) { System.out.println(status.getPath()); System.out.println(status); if (i++ > 10) { System.out.println("only first 10 showed..."); break; } } return null; } }); {code} -- This message was sent by Atlassian JIRA (v6.1.5#6160)