Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74682 invoked from network); 15 Mar 2007 15:53:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 15:53:01 -0000 Received: (qmail 69309 invoked by uid 500); 15 Mar 2007 15:53:07 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 69281 invoked by uid 500); 15 Mar 2007 15:53:07 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 69272 invoked by uid 99); 15 Mar 2007 15:53:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 08:53:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of stefan.guggisberg@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 08:52:56 -0700 Received: by ug-out-1314.google.com with SMTP id p31so366328ugc for ; Thu, 15 Mar 2007 08:52:34 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kOdqYuNBHmqKbe/K8UV+1FwUUUin31tnUZuj099WQq7JM78RFSZjwJVYReTiBeRfroB7avHFwzwVBXDiIVCtBQz+m71AoGZ0/ZuUtsbRy8jnp3+PqBKID1hSmHITc4uY8d+g++1t4GIs/4ahqKNE0yIphBAYb1NmL15OVjHjzYo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cnPadQqNGlvykesXkCTL/+0BrzOBcN9wk1O4V2TPqyeMFaNdoxSL7Ozda4BrK/cTMYsSZrxPgnAKNfEnxVmH09MWTY4goWbbfUESth4IJElMPCSV2b2M/Okpd3o6hefGXEMxZucWfEb/+4xW73CFi1LPcsHq+S9aV+FnsRhSn24= Received: by 10.78.204.20 with SMTP id b20mr433402hug.1173973953991; Thu, 15 Mar 2007 08:52:33 -0700 (PDT) Received: by 10.49.3.2 with HTTP; Thu, 15 Mar 2007 08:52:33 -0700 (PDT) Message-ID: <90a8d1c00703150852s15ec654eu43c1299d5af8a709@mail.gmail.com> Date: Thu, 15 Mar 2007 16:52:33 +0100 From: "Stefan Guggisberg" To: dev@jackrabbit.apache.org Subject: Re: Session.impersonate vs Credentials In-Reply-To: <45F80EB8.4050804@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45F80EB8.4050804@gmx.de> X-Virus-Checked: Checked by ClamAV on apache.org hi julian, On 3/14/07, Julian Reschke wrote: > Hi, > > I noticed that the Session implementations both in Jackrabbit and > JCR2SPI require that the Credentials object passed into the > impersonate() method actually is a SimpleCredentials object. The purpose > seems to be that the "impersonating session" can be remembered in an > attribute on the credentials. wrt the jackrabbit implementation: yes, that's correct. > > JSR-170 however doesn't mention anything about that. correct too. the specifics of the impersonating mechanism was considered an implementation detail. > > So...: > > - is this just plainly unimportant? (such as in "nobody uses impersonate > anyway, it's simple enough to do a regular login) no, that's certainly not the intention. the reference implementation (and therefore jackrabbit) had chosen a quite simple approach to implement this feature: the impersonator (i.e. the authenticated Subject) is stored in a Credentials attribute. Authorizing an 'impersonate' request is delegated to the pluggable LoginModule. here's the relevant piece of code in SimpleLoginModule (a dummy implementation): Object attr = sc.getAttribute(SecurityConstants.IMPERSONATOR_ATTRIBUTE); if (attr != null && attr instanceof Subject) { // Subject impersonator = (Subject) attr; // @todo check privileges to 'impersonate' the user represented by the supplied credentials } else { ... > > - is this a TODO? (the code in JCR2SPI's SessionImpl seems to indicate > that...) - if it is, should we define an extension to SimpleCredentials > that can hold the required information, so that we don't rely on a > specific impl class? again, wrt jackrabbit/jsr-170: since we've left the specifics of the 'impersonate' mechanism up to the implementation we don't know what is required to identify an impersonating session. an extension to SimpleCredentials would therefore not help since it implies username/password credentials. cheers stefan > > > Best regards, Julian >