List of usage examples for org.springframework.security.core.userdetails UserDetailsService UserDetailsService
UserDetailsService
From source file:org.springframework.security.web.authentication.www.DigestAuthenticationFilterTests.java
@Before public void setUp() { SecurityContextHolder.clearContext(); // Create User Details Service UserDetailsService uds = new UserDetailsService() { public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return new User("rod,ok", "koala", AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO")); }/*from w w w .j a v a 2s.c o m*/ }; DigestAuthenticationEntryPoint ep = new DigestAuthenticationEntryPoint(); ep.setRealmName(REALM); ep.setKey(KEY); filter = new DigestAuthenticationFilter(); filter.setUserDetailsService(uds); filter.setAuthenticationEntryPoint(ep); request = new MockHttpServletRequest("GET", REQUEST_URI); request.setServletPath(REQUEST_URI); }