Search in sources :

Example 1 with AbstractWebApplicationService

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

the class DefaultLogoutManagerTests method getService.

public static AbstractWebApplicationService getService(final String url) {
    val request = new MockHttpServletRequest();
    request.addParameter("service", url);
    return (AbstractWebApplicationService) new WebApplicationServiceFactory().createService(request);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService)

Example 2 with AbstractWebApplicationService

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

the class DefaultSingleLogoutServiceLogoutUrlBuilderTests method getService.

public static AbstractWebApplicationService getService(final String url) {
    val request = new MockHttpServletRequest();
    request.addParameter("service", url);
    return (AbstractWebApplicationService) new WebApplicationServiceFactory().createService(request);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService)

Example 3 with AbstractWebApplicationService

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

the class CentralAuthenticationServiceImplTests method verifyProxyGrantingTicketHasRootAuthenticationAsPrincipal.

@Test
public void verifyProxyGrantingTicketHasRootAuthenticationAsPrincipal() {
    final AuthenticationResult ctx = CoreAuthenticationTestUtils.getAuthenticationResult(getAuthenticationSystemSupport(), getService());
    final TicketGrantingTicket ticket = getCentralAuthenticationService().createTicketGrantingTicket(ctx);
    final ServiceTicket serviceTicketId = getCentralAuthenticationService().grantServiceTicket(ticket.getId(), getService(), ctx);
    final AbstractWebApplicationService service = AbstractWebApplicationService.class.cast(serviceTicketId.getService());
    assertEquals(service.getPrincipal(), ticket.getAuthentication().getPrincipal().getId());
}
Also used : TicketGrantingTicket(org.apereo.cas.ticket.TicketGrantingTicket) ServiceTicket(org.apereo.cas.ticket.ServiceTicket) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService) AuthenticationResult(org.apereo.cas.authentication.AuthenticationResult) Test(org.junit.Test)

Example 4 with AbstractWebApplicationService

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

the class SessionHealthIndicatorTests method getService.

public static AbstractWebApplicationService getService(final String name) {
    val request = new MockHttpServletRequest();
    request.addParameter("service", name);
    return (AbstractWebApplicationService) new WebApplicationServiceFactory().createService(request);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService)

Example 5 with AbstractWebApplicationService

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

the class RegisteredServiceTestUtils method getService.

public static AbstractWebApplicationService getService(final String name) {
    val request = new MockHttpServletRequest();
    request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, name);
    return (AbstractWebApplicationService) new WebApplicationServiceFactory().createService(request);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) AbstractWebApplicationService(org.apereo.cas.authentication.principal.AbstractWebApplicationService)

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