use of org.apereo.cas.authentication.RememberMeUsernamePasswordCredential in project cas by apereo.
the class ShiroAuthenticationHandlerTests method checkAuthenticationSuccessful.
@Test
public void checkAuthenticationSuccessful() throws Exception {
final ShiroAuthenticationHandler shiro = new ShiroAuthenticationHandler("", null, null, Collections.emptySet(), Collections.emptySet());
shiro.loadShiroConfiguration(new ClassPathResource("shiro.ini"));
final RememberMeUsernamePasswordCredential creds = new RememberMeUsernamePasswordCredential();
creds.setRememberMe(true);
creds.setUsername("casuser");
creds.setPassword("Mellon");
assertNotNull(shiro.authenticate(creds));
}
use of org.apereo.cas.authentication.RememberMeUsernamePasswordCredential in project cas by apereo.
the class ShiroAuthenticationHandlerTests method checkAuthenticationSuccessfulRolesAndPermissions.
@Test
public void checkAuthenticationSuccessfulRolesAndPermissions() throws Exception {
final ShiroAuthenticationHandler shiro = new ShiroAuthenticationHandler("", null, null, Collections.singleton("admin"), Collections.singleton("superuser:deleteAll"));
shiro.loadShiroConfiguration(new ClassPathResource("shiro.ini"));
final RememberMeUsernamePasswordCredential creds = new RememberMeUsernamePasswordCredential();
creds.setRememberMe(true);
creds.setUsername("casuser");
creds.setPassword("Mellon");
assertNotNull(shiro.authenticate(creds));
}
Aggregations