Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 29594 invoked from network); 10 Nov 2008 10:59:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Nov 2008 10:59:14 -0000 Received: (qmail 39153 invoked by uid 500); 10 Nov 2008 10:59:20 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 39089 invoked by uid 500); 10 Nov 2008 10:59:20 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 39077 invoked by uid 99); 10 Nov 2008 10:59:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 02:59:20 -0800 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 10:58:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 43E91234C286 for ; Mon, 10 Nov 2008 02:58:44 -0800 (PST) Message-ID: <211495153.1226314724264.JavaMail.jira@brutus> Date: Mon, 10 Nov 2008 02:58:44 -0800 (PST) From: "Vamsavardhana Reddy (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-4367) default-subject does not work with EJB security In-Reply-To: <1476724106.1224265424417.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-4367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vamsavardhana Reddy updated GERONIMO-4367: ------------------------------------------ Comment: was deleted > default-subject does not work with EJB security > ----------------------------------------------- > > Key: GERONIMO-4367 > URL: https://issues.apache.org/jira/browse/GERONIMO-4367 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: security > Affects Versions: 2.1.3, 2.2 > Reporter: Vamsavardhana Reddy > Fix For: 2.2 > > Attachments: GERONIMO-4367-testcase.zip > > > The default-subject does not seem to work with EJB security. I have verified this in the following scenario: > I have a stateless bean BankBean1 as given below: > @Stateless > @DeclareRoles(value = {"bank", "customer"}) > public class BankBean1 implements Bank { > @RolesAllowed({"customer", "bank"}) > public Double getBalance(Integer account) { > return data.get(account); > } > > @RolesAllowed({"bank"}) > public Double creditAccount(Integer account, Double amt) { > ... > return value; > } > @RolesAllowed({"bank"}) > public Double debitAccount(Integer account, Double amt) { > ... > return value; > } > } > I have a second stateless bean BankBean2 that has a reference injected to BankBean1 and uses @RunAs as given below: > @Stateless > @DeclareRoles(value = {"bank", "customer"}) > @RunAs(value = "bank") > public class BankBean2 implements Bank2 { > > @EJB > private Bank bank; // BankBean1 gets injected here. > public Double getBalance(Integer account) { > return bank.getBalance(account); > } > > public Double creditAccount(Integer account, Double amt) { > return bank.creditAccount(account, amt); > } > public Double debitAccount(Integer account, Double amt) { > return bank.debitAccount(account, amt); > } > } > In the security mapping in openejb-jar.xml, if I specify a run-as-subject for "bank" role, BankBean2 is able to invoke BankBean1 as per that run-as-subject specified. But if I don't specify a run-as-subject, but only use a default-subject, BankBean2 is unable to invoke BankBean1 as per the default-subject specified. > Also see http://www.nabble.com/How-is-the-default-subject-used-in-EJB-security--td20021936s134.html#a20021936 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.