Return-Path: Delivered-To: apmail-portals-jetspeed-dev-archive@www.apache.org Received: (qmail 97400 invoked from network); 9 Feb 2009 14:18:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 14:18:15 -0000 Received: (qmail 84560 invoked by uid 500); 9 Feb 2009 14:18:14 -0000 Delivered-To: apmail-portals-jetspeed-dev-archive@portals.apache.org Received: (qmail 84530 invoked by uid 500); 9 Feb 2009 14:18:14 -0000 Mailing-List: contact jetspeed-dev-help@portals.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jetspeed Developers List" Delivered-To: mailing list jetspeed-dev@portals.apache.org Received: (qmail 84517 invoked by uid 99); 9 Feb 2009 14:18:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 06:18:14 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [216.200.145.38] (HELO omta0109.mta.everyone.net) (216.200.145.38) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 14:18:08 +0000 Received: from sj1-dm101.mta.everyone.net (sj1-slb03-gw2 [172.16.1.96]) by omta0109.mta.everyone.net (Postfix) with ESMTP id BA87563B3C for ; Mon, 9 Feb 2009 06:31:57 -0800 (PST) X-Eon-Dm: sj1-dm101 Received: by sj1-dm101.mta.everyone.net (EON-AUTHRELAY2 - 426dd405) id sj1-dm101.4981cdc2.3c550a for ; Mon, 9 Feb 2009 06:17:47 -0800 X-Eon-Sig: AQLYMZZJkDsLO3bG/AIAAAAB,61b9528b108223c90fa94e0aa2e38f33 Message-ID: <49903AFE.6080508@wispertel.net> Date: Mon, 09 Feb 2009 07:17:34 -0700 From: Randy Watler User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Jetspeed Developers List Subject: Re: SSO PasswordCredential Question References: <498FFA59.1020500@wispertel.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dennis/Ate, The credential is not transient. It is persistent and I verified it was written to the database. The "feature" is that setting a password is deferred by transient tracking members in PasswordCredentialImpl. With OBJ, a new credential instance is read from the DB on every access and that circumvents the set password tracking. With JPA, the objects are cached. Within the same transaction, you are ensured of getting the same instance back, even if it has been flushed to the database on a commit. Because its the same instance, the getPassword() access retrieves the old value, despite the fact that the credential has in fact been updated. I do not want to do something that is wrong here. The deferred password set operation is there for a reason no doubt, but I am wondering if it is safe to override that capability in this case. Perhaps Ate can comment on why PasswordCredential does this in general and if it is appropriate to disable it here? Randy Dennis Dam wrote: > Hi Randi, > > it's fine by me if you don't have other options. I guess you can't (or don't want to) force a write-through of the password, and discard the transient credential? > > regards, > Dennis > > -----Oorspronkelijk bericht----- > Van: Randy Watler [mailto:watler@wispertel.net] > Verzonden: ma 9-2-2009 10:41 > Aan: Jetspeed Developers List > Onderwerp: SSO PasswordCredential Question > > Ate/Dennis, > > In SSOManagerImpl.setPassword(), we invoke > PasswordCredential.setPassword(xxx, false) from > TestSSOManager.testCredentials() and then requery the password later in > the test to see if it has changed. > > This works fine with OBJ, but with JPA I get the same PasswordCredential > instance back on the requery because it is in an > 'Extended'/'Conversational' transaction. As a result, the 'new password > set' transient tracking in PrincipalCredentialImpl is active and is as > if the user just set the password. This means that the > PasswordCredential.getPassword() returns the previous password value and > the test fails. > > I am wondering if immediately after the PasswordCredential.setPassword() > call the SSOManagetImpl.setPassword() method should invoke > PasswordCredential.clearNewPasswordSet()? That seems like it might make > sense in this case since we're forcing a password change, no? > > Randy > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org > > > > > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org > For additional commands, e-mail: jetspeed-dev-help@portals.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org For additional commands, e-mail: jetspeed-dev-help@portals.apache.org