Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-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 F34C99106 for ; Fri, 15 Jun 2012 04:10:43 +0000 (UTC) Received: (qmail 4749 invoked by uid 500); 15 Jun 2012 04:10:43 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 4636 invoked by uid 500); 15 Jun 2012 04:10:43 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 4596 invoked by uid 99); 15 Jun 2012 04:10:42 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2012 04:10:42 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 991EE141BF8 for ; Fri, 15 Jun 2012 04:10:42 +0000 (UTC) Date: Fri, 15 Jun 2012 04:10:42 +0000 (UTC) From: "Raj Saini (JIRA)" To: dev@activemq.apache.org Message-ID: <1893985663.17698.1339733442629.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1641436527.17507.1339724922568.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Comment Edited] (AMQ-3883) activemq-jaas authorization doesn't work with Karaf JAAS LoginModule 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/AMQ-3883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295445#comment-13295445 ] Raj Saini edited comment on AMQ-3883 at 6/15/12 4:09 AM: --------------------------------------------------------- Hello Freeman, Would it not be better to compare the getName() method of Principal interface? For example: public boolean equals(Object o) { if (this == o) { return true; } if(o instanceof Principal) { if (((Principal) o).getName().equals(this.getName())) { return true; } } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal)o; if (!name.equals(that.name)) { return false; } return true; } This way, compare will not only work with any other JAAS implementation. was (Author: rajsaini): Hello Freeman, Would it not be better to compare the getName() method of Principal interface? For example: {{monospaced}} public boolean equals(Object o) { if (this == o) { return true; } if(o instanceof Principal) { if (((Principal) o).getName().equals(this.getName())) { return true; } } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal)o; if (!name.equals(that.name)) { return false; } return true; } This way, compare will not only work with any other JAAS implementation. > activemq-jaas authorization doesn't work with Karaf JAAS LoginModule > -------------------------------------------------------------------- > > Key: AMQ-3883 > URL: https://issues.apache.org/jira/browse/AMQ-3883 > Project: ActiveMQ > Issue Type: Bug > Reporter: Freeman Fang > Attachments: AMQ-3883.patch > > > currently activemq-jaas can't work with karaf loginModule, the reason comes from the compare between > amq GroupPrincipal and karaf UserPrincipal/RolePrincipal doesn't work > More details please see[1]. > We have a similar issue in Servicemix NMR[2] and the fix can honor the compare between > amq GroupPrincipal and karaf UserPrincipal/RolePrincipal yet not introduce any dependency between activemq-jaas and karaf jaas. > [1]http://karaf.922171.n3.nabble.com/Karaf-ActiveMQ-authorization-problem-td4024834.html > [2]https://issues.apache.org/jira/browse/SMX4NMR-283 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira