1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.userdetails;
17
18 import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
19 import org.springframework.dao.DataAccessException;
20
21
22 /***
23 * Defines an interface for implementations that wish to provide data access
24 * services to the {@link DaoAuthenticationProvider}.
25 *
26 * <p>
27 * The interface requires only one read-only method, which simplifies support
28 * of new data access strategies.
29 * </p>
30 *
31 * @author Ben Alex
32 * @version $Id: UserDetailsService.java,v 1.9 2005/11/29 13:10:10 benalex Exp $
33 */
34 public interface UserDetailsService {
35
36
37 /***
38 * Locates the user based on the username. In the actual implementation,
39 * the search may possibly be case insensitive, or case insensitive
40 * depending on how the implementaion instance is configured. In this
41 * case, the <code>UserDetails</code> object that comes back may have a
42 * username that is of a different case than what was actually requested..
43 *
44 * @param username the username presented to the {@link
45 * DaoAuthenticationProvider}
46 *
47 * @return a fully populated user record (never <code>null</code>)
48 *
49 * @throws UsernameNotFoundException if the user could not be found or the
50 * user has no GrantedAuthority
51 * @throws DataAccessException if user could not be found for a
52 * repository-specific reason
53 */
54 public UserDetails loadUserByUsername(String username)
55 throws UsernameNotFoundException, DataAccessException;
56 }