Line | |
---|
1 | package gov.va.med.edp.springframework.security.userdetails.memory;
|
---|
2 |
|
---|
3 | import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
|
---|
4 | import gov.va.med.edp.springframework.security.userdetails.VistaUserDetailsService;
|
---|
5 | import org.springframework.security.BadCredentialsException;
|
---|
6 | import org.springframework.dao.DataAccessException;
|
---|
7 | import org.springframework.beans.factory.InitializingBean;
|
---|
8 | import org.springframework.util.Assert;
|
---|
9 |
|
---|
10 | public class InMemoryDaoImpl implements VistaUserDetailsService, InitializingBean {
|
---|
11 |
|
---|
12 | private VistaUserMap userMap;
|
---|
13 |
|
---|
14 | public void afterPropertiesSet() throws Exception {
|
---|
15 | Assert.notNull(this.userMap,
|
---|
16 | "A list of user duz, station numbers, access/verify codes, enabled/disabled status and their granted authorities must be set");
|
---|
17 | }
|
---|
18 |
|
---|
19 | public VistaUserDetails login(String stationNumber, String accessCode, String verifyCode, String remoteAddress) throws BadCredentialsException, DataAccessException {
|
---|
20 | return userMap.getUser(stationNumber, accessCode, verifyCode);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public void logout(VistaUserDetails user) throws DataAccessException {
|
---|
24 | // NOOP
|
---|
25 | }
|
---|
26 |
|
---|
27 | public VistaUserMap getUserMap() {
|
---|
28 | return userMap;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public void setUserMap(VistaUserMap userMap) {
|
---|
32 | this.userMap = userMap;
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.