use of org.springframework.security.web.authentication.www.DigestAuthenticationEntryPoint in project spring-security by spring-projects.
the class SecurityMockMvcRequestPostProcessorsDigestTests method setup.
@Before
public void setup() {
this.password = "password";
request = new MockHttpServletRequest();
entryPoint = new DigestAuthenticationEntryPoint();
entryPoint.setKey("key");
entryPoint.setRealmName("Spring Security");
filter = new DigestAuthenticationFilter();
filter.setUserDetailsService(new UserDetailsService() {
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return new User(username, password, AuthorityUtils.createAuthorityList("ROLE_USER"));
}
});
filter.setAuthenticationEntryPoint(entryPoint);
filter.afterPropertiesSet();
}
Aggregations