Announcement Announcement Module
Collapse
No announcement yet.
configuring spring security for Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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
    Code:
    <!-- Configure Authentication mechanism -->
        <authentication-manager alias="authenticationManager">
    	<authentication-provider user-service-ref="mySecurityService"/>
        </authentication-manager>
    MySecurityService.java

    Code:
    @Service("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 org.springframework.security.core.userdetails.User

    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, 01:25 AM.

    Comment

    Working...
    X