Announcement Announcement Module
No announcement yet.
configuring spring security for Roo Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • configuring spring security for Roo

    I am trying to configure Spring security for a Roo project and would appreciate any pointers.

    What I have is

    in applicationContext-security.xml file
    <!-- Configure Authentication mechanism -->
        <authentication-manager alias="authenticationManager">
    	<authentication-provider user-service-ref="mySecurityService"/>

    public class MySecurityService implements UserDetailsService {
      private MySecurityDelegate securityDelegate = new MySecurityDelegate();
      private MyUserAssembler assemblerService = new MyUserAssembler();
      @Transactional(readOnly = true)
      public UserDetails loadUserByUsername(String username)
          throws UsernameNotFoundException, DataAccessException {
          MyUser user = securityDelegate.findUserByUsername(username);
          if(user == null) throw new UsernameNotFoundException(username);
          return assemblerService.buildAuthenticatedUserFromUser(user);
    assemblerService.buildAuthenticatedUserFromUser() returns a class that extends

    My questions are

    1. How to get the password that the user entered on a login screen?
    2. How to setup RememberMe?
    3. How can I have Spring hash the passwords on a Sign up screen?

    Thanks in advance

  • #2
    Edit: on second thought, can you be clear on what do you mean how to get the password. Do you want to play with the entered pasword in spring? I think in default setup that is not possible. all you get an authentication token.

    If you want to setup more advanced things, I would recommend you a copt of Spring Security Book (by pmularien from the forums). There are code samples in spring security project and there is documentation in the security ref guide, but the book will save you much time. It covers in depth about salting, hashing, remember me, ACL etc.
    Last edited by hatim; Dec 14th, 2010, 12:25 AM.