[EMAIL PROTECTED] wrote:
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


Hi Jason,

Set up your login-prcedure to redirect you to a certain page after successful login. Then, on that particular page put this code to get the Authentication-object. Then, You can put the Authentication object into the ASO-object.

I currently use this code in my border-component, so it executes way too often. But I'll get to that eventually.

~ Arjan Verstoep

   private Authentication getAuthentication(IRequestCycle cycle) {
       Authentication auth = null;
WebSession session = cycle.getInfrastructure().getRequest().getSession(false);
       if (session!=null) {
SecurityContext sc = (SecurityContext) session.getAttribute(HttpSessionContextIntegrationFilter.ACEGI_SECURITY_CONTEXT_KEY);
           if (sc!=null) {
                auth = sc.getAuthentication();
           }
       }
       return auth;
   }



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

Reply via email to