[1240] | 1 | package gov.va.med.edp.springframework.security.userdetails;
|
---|
| 2 |
|
---|
| 3 | import org.springframework.security.BadCredentialsException;
|
---|
| 4 | import org.springframework.dao.DataAccessException;
|
---|
| 5 |
|
---|
| 6 | /**
|
---|
| 7 | * Defines an interface for implementations that wish to provide data access
|
---|
| 8 | * services to the {@link gov.va.med.edp.springframework.security.providers.vistalink.VistaAuthenticationProvider}.
|
---|
| 9 | *
|
---|
| 10 | * <p>
|
---|
| 11 | * The interface requires only one read-only method, which simplifies support
|
---|
| 12 | * of new data access strategies.
|
---|
| 13 | * </p>
|
---|
| 14 | */
|
---|
| 15 | public interface VistaUserDetailsService {
|
---|
| 16 | /**
|
---|
| 17 | * Locates the user based on the username. In the actual implementation, the search may possibly be case
|
---|
| 18 | * insensitive, or case insensitive depending on how the implementaion instance is configured. In this case, the
|
---|
| 19 | * <code>UserDetails</code> object that comes back may have a username that is of a different case than what was
|
---|
| 20 | * actually requested..
|
---|
| 21 | *
|
---|
| 22 | // * @param username the username presented to the {@link org.springframework.security.providers.dao.DaoAuthenticationProvider}
|
---|
| 23 | *
|
---|
| 24 | * @return a fully populated user record (never <code>null</code>)
|
---|
| 25 | *
|
---|
| 26 | * @throws org.springframework.security.userdetails.UsernameNotFoundException if the user could not be found or the user has no GrantedAuthority
|
---|
| 27 | * @throws org.springframework.dao.DataAccessException if user could not be found for a repository-specific reason
|
---|
| 28 | */
|
---|
| 29 | VistaUserDetails login(String stationNumber, String accessCode, String verifyCode, String remoteAddress)
|
---|
| 30 | throws BadCredentialsException, DataAccessException;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | *
|
---|
| 34 | * @param user
|
---|
| 35 | */
|
---|
| 36 | void logout(VistaUserDetails user) throws DataAccessException;
|
---|
| 37 | }
|
---|