I can't say it's a best practice, but it should be a reasonable strategy.  

In your pageValidate() method, 
        if your ASO is not set
                Authentication auth = 
                SecurityContext.getContext().getAuthentication();
                If auth is not null
                        Object principal = auth.getPrincipal();
                        If (principal instanceof UserDetails)
                                Cast and put into ASO
                
If you are using Hibernate or another persistence framework, and need to
navigate the object graph from your ASO, reattach / refresh before doing it.
I'm doing that in pageValidate() as well (and I'm using the Spring OSIV
filter).


It would be a little neater to extract out all of the Acegi stuff so your UI
code doesn't depend on Acegi.


Jonathan

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 30, 2006 7:34 AM
> To: users@tapestry.apache.org
> Subject: Populating Tapestry ASO after successful Acegi Auth
> 
> Greetings:
> 
> I'm using Tapestry 4 and Acegi 1.0.1.  I have acegi set up to perform
> authentication using the AuthenticationProcessingFilter.  I have a
> requirement to place the domain object the Acegi UserDetails object is
> based upon into a Tapestry ASO for use during the user session. =20
> 
> My question is: what the best practice for filling the Tapestry ASO with
> the domain model's user object upon successful authentication with
> Acegi?
> 
> Thanks,
> 
> -jason
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to