Search in sources :

Example 6 with AbstractWebApplicationService

use of org.apereo.cas.authentication.principal.AbstractWebApplicationService in project cas by apereo.

the class DefaultCentralAuthenticationServiceTests method verifyProxyGrantingTicketHasRootAuthenticationAsPrincipal.

@Test
public void verifyProxyGrantingTicketHasRootAuthenticationAsPrincipal() {
    val ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), getService());
    val ticket = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
    val serviceTicketId = getCentralAuthenticationService().grantServiceTicket(ticket.getId(), getService(), ctx);
    val service = (AbstractWebApplicationService) serviceTicketId.getService();
    assertEquals(service.getPrincipal(), ticket.getAuthentication().getPrincipal().getId());
}
Also used : lombok.val(lombok.val) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractWebApplicationService (org.apereo.cas.authentication.principal.AbstractWebApplicationService)6 lombok.val (lombok.val)5 WebApplicationServiceFactory (org.apereo.cas.authentication.principal.WebApplicationServiceFactory)4 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)4 AuthenticationResult (org.apereo.cas.authentication.AuthenticationResult)1 ServiceTicket (org.apereo.cas.ticket.ServiceTicket)1 TicketGrantingTicket (org.apereo.cas.ticket.TicketGrantingTicket)1 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1