I was just about to submit a patch to the tapestry-acegi plugin app to use a slightly different approach. My take on it is that the acegi module is missing a utility class that would allow a user to be logged in:
1. In the AppModule, I contribute a LoginHelper service (the one I think that should be in the tapestry-acegi plugin) public static LoginHelper buildLoginHelper(@InjectService("MySaltSource") SaltSourceService saltSource, PasswordEncoder encrypter , AuthenticationManager authManager) { return new AcegiLoginHelper(authManager,saltSource,encrypter); } 2. This is the login helper : public class AcegiLoginHelper implements LoginHelper { private final SaltSource saltSource; private final PasswordEncoder encrypter; private final AuthenticationManager authManager; public AcegiLoginHelper(AuthenticationManager authManager, SaltSource saltSource, PasswordEncoder encrypter) { this.saltSource = saltSource; this.encrypter = encrypter; this.authManager = authManager; } public String encryptPassword(UserLogin userDetails, String plainTxtPwd) { return encrypter.encodePassword(plainTxtPwd, saltSource.getSalt(userDetails)); } public void authenticateUser(String username, String plainTxtPwd) { UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, plainTxtPwd); try { Authentication authentication = authManager.authenticate(authRequest); SecurityContextHolder.getContext().setAuthentication(authentication); } catch (BadCredentialsException e) { LOG.info("Failed login by user '" + username + "'."); } catch (AuthenticationException e) { LOG.error("Could not authenticate a user", e); } catch (RuntimeException e) { LOG.error(e); e.printStackTrace(); throw e; } } } 3. In the page that needs to perform the login, inject the login helper and do something like: loginHelper.authenticateUser(regInfo.getUsername(), regInfo.getPassword()); For all of this, you don't need to use the tapestry-acegi plugin, it should work with any Acegi setup, assuming that you use Salt. If you don't use salt, customize for your needs. Cheers, Alex Kotchnev On Sun, Aug 31, 2008 at 1:06 AM, Alex Florentino <[EMAIL PROTECTED]>wrote: > Hi all, > loginHelper.authenticateUser(regInfo.getUsername(), regInfo.getPassword()); > I am newbie with tapestry 5, I am using the project > http://shams.googlecode.com/files/spring-acegi-derby-phonbook-src.zip with > sample project, but I get a problem at Login.java : > > Link link = new LinkImpl(response, request.getContextPath(), > "j_acegi_security_check"); > > link.addParameter("j_username", username); > link.addParameter("j_password", password); > return link; > > but I am using 5.0.14 and LinkImpl not have this constructor ... and not > found javadoc about LinkImpl, how is the best way fix this problem ? > > thanks, > > Alex >