use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class CentralAuthenticationServiceImplTests method verifyGrantingOfServiceTicketUsingDefaultTicketIdGen.
@Test
public void verifyGrantingOfServiceTicketUsingDefaultTicketIdGen() {
final Service mockService = RegisteredServiceTestUtils.getService("testDefault");
final AuthenticationResult ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), mockService);
final TicketGrantingTicket ticketId = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
final ServiceTicket serviceTicketId = getCentralAuthenticationService().grantServiceTicket(ticketId.getId(), mockService, ctx);
assertNotNull(serviceTicketId);
}
use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class MultifactorAuthenticationTests method verifyAllowsAccessToNormalSecurityServiceWithOTP.
@Test
public void verifyAllowsAccessToNormalSecurityServiceWithOTP() {
final AuthenticationResult ctx = processAuthenticationAttempt(NORMAL_SERVICE, new OneTimePasswordCredential(ALICE, PASSWORD_31415));
final TicketGrantingTicket tgt = cas.createTicketGrantingTicket(ctx);
assertNotNull(tgt);
final ServiceTicket st = cas.grantServiceTicket(tgt.getId(), NORMAL_SERVICE, ctx);
assertNotNull(st);
}
use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class MultifactorAuthenticationTests method verifyDeniesAccessToHighSecurityServiceWithPassword.
@Test
public void verifyDeniesAccessToHighSecurityServiceWithPassword() {
final AuthenticationResult ctx = processAuthenticationAttempt(HIGH_SERVICE, newUserPassCredentials(ALICE, ALICE));
this.thrown.expect(UnsatisfiedAuthenticationPolicyException.class);
final TicketGrantingTicket tgt = cas.createTicketGrantingTicket(ctx);
assertNotNull(tgt);
cas.grantServiceTicket(tgt.getId(), HIGH_SERVICE, ctx);
}
use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class MultifactorAuthenticationTests method verifyAllowsAccessToNormalSecurityServiceWithPassword.
@Test
public void verifyAllowsAccessToNormalSecurityServiceWithPassword() {
final AuthenticationResult ctx = processAuthenticationAttempt(NORMAL_SERVICE, newUserPassCredentials(ALICE, ALICE));
final TicketGrantingTicket tgt = cas.createTicketGrantingTicket(ctx);
assertNotNull(tgt);
final ServiceTicket st = cas.grantServiceTicket(tgt.getId(), NORMAL_SERVICE, ctx);
assertNotNull(st);
}
use of org.apereo.cas.authentication.AuthenticationResult in project cas by apereo.
the class GenerateServiceTicketActionTests method onSetUp.
@Before
public void onSetUp() {
final AuthenticationResult authnResult = getAuthenticationSystemSupport().handleAndFinalizeSingleAuthenticationTransaction(CoreAuthenticationTestUtils.getService(), CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());
this.ticketGrantingTicket = getCentralAuthenticationService().createTicketGrantingTicket(authnResult);
getTicketRegistry().addTicket(this.ticketGrantingTicket);
}
Aggregations