use of org.apereo.cas.authentication.principal.Response in project cas by apereo.
the class GoogleAccountsServiceFactoryTests method verifyAuthnRequest.
@Test
public void verifyAuthnRequest() throws Exception {
final MockHttpServletRequest request = new MockHttpServletRequest();
final String samlRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" " + "ID=\"5545454455\" Version=\"2.0\" IssueInstant=\"Value\" " + "ProtocolBinding=\"urn:oasis:names.tc:SAML:2.0:bindings:HTTP-Redirect\" " + "ProviderName=\"https://localhost:8443/myRutgers\" AssertionConsumerServiceURL=\"https://localhost:8443/myRutgers\"/>";
request.setParameter(SamlProtocolConstants.PARAMETER_SAML_REQUEST, encodeMessage(samlRequest));
final GoogleAccountsService service = (GoogleAccountsService) this.factory.createService(request);
service.setPrincipal(CoreAuthenticationTestUtils.getPrincipal());
assertNotNull(service);
final Response response = googleAccountsServiceResponseBuilder.build(service, "SAMPLE_TICKET");
assertNotNull(response);
}
use of org.apereo.cas.authentication.principal.Response in project cas by apereo.
the class RedirectToServiceAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
final WebApplicationService service = WebUtils.getService(requestContext);
final String serviceTicketId = WebUtils.getServiceTicketFromRequestScope(requestContext);
final Response response = responseBuilderLocator.locate(service).build(service, serviceTicketId);
WebUtils.putServiceResponseIntoRequestScope(requestContext, response);
WebUtils.putServiceOriginalUrlIntoRequestScope(requestContext, service);
return new EventFactorySupport().event(this, response.getResponseType().name().toLowerCase());
}
Aggregations