Apprendre à créer des UserDetail Objet au Printemps de Sécurité

J'ai construit mon personnalisée Authenticaton Manager pour le Printemps de Sécurité qui va quelque chose comme ceci

   public class AccountAuthenticationProvider implements  AuthenticationProvider{

    @Autowired
    private AuthenticationService authService;

    @Override
    public Authentication authenticate(Authentication authentication) throws AuthenticationException {

        String userName = authentication.getName();
        String password = (String)authentication.getCredentials();

        if(authService.isValid(userName,password)){
            List<GrantedAuthority> grantedAuthorityList = new ArrayList<GrantedAuthority>();
            grantedAuthorityList.add(new SimpleGrantedAuthority("ROLE_USER"));
            SecurityContext securityContext = new SecurityContextImpl();
            return  new UsernamePasswordAuthenticationToken(userName,password);
        }

        return null;
    }


    public void setAuthService(AuthenticationService authService) {
        this.authService = authService;
    }

    @Override
    public boolean supports(Class<?> authentication) {
        return true;
    }

}

mais comment puis-je créer mon propre UserDetail objet? Je vais l'utiliser pour stocker les compte les valeurs liées

InformationsquelleAutor user962206 | 2014-10-19