assertThat(acs.get(0).getLocation()) .isEqualTo("http://" + spHostname + ':' + rule.httpPort() + "/saml/acs/post"); assertThat(acs.get(0).getBinding()).isEqualTo(SAMLConstants.SAML2_POST_BINDING_URI); assertThat(acs.get(1).getLocation()) .isEqualTo("http://" + spHostname + ':' + rule.httpPort() + "/saml/acs/redirect"); assertThat(acs.get(1).getBinding()).isEqualTo(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
protected void verifyRequest(final AuthnRequest request, final SAML2MessageContext context) { // Verify endpoint requested in the original request final AssertionConsumerService assertionConsumerService = (AssertionConsumerService) context.getSAMLEndpointContext() .getEndpoint(); if (request.getAssertionConsumerServiceIndex() != null) { if (!request.getAssertionConsumerServiceIndex().equals(assertionConsumerService.getIndex())) { logger.warn("Response was received at a different endpoint index than was requested"); } } else { final String requestedResponseURL = request.getAssertionConsumerServiceURL(); final String requestedBinding = request.getProtocolBinding(); if (requestedResponseURL != null) { final String responseLocation; if (assertionConsumerService.getResponseLocation() != null) { responseLocation = assertionConsumerService.getResponseLocation(); } else { responseLocation = assertionConsumerService.getLocation(); } if (!requestedResponseURL.equals(responseLocation)) { logger.warn("Response was received at a different endpoint URL {} than was requested {}", responseLocation, requestedResponseURL); } } if (requestedBinding != null && !requestedBinding.equals(context.getSAMLBindingContext().getBindingUri())) { logger.warn("Response was received using a different binding {} than was requested {}", context.getSAMLBindingContext().getBindingUri(), requestedBinding); } } }
private void prepareArtifactContext(final Response samlResponse, final MessageContext ctx) { val art = ctx.getSubcontext(SAMLArtifactContext.class, true); art.setArtifactType(SAML2ArtifactType0004.TYPE_CODE); art.setSourceEntityId(samlResponse.getIssuer().getValue()); val svc = adaptor.getAssertionConsumerServiceForArtifactBinding(); art.setSourceArtifactResolutionServiceEndpointIndex(svc.getIndex()); art.setSourceArtifactResolutionServiceEndpointURL(svc.getLocation()); } }
providerId, SAMLConstants.SAML2_POST_BINDING_URI); val acs = facade.getAssertionConsumerService(SAMLConstants.SAML2_POST_BINDING_URI); if (acs == null || StringUtils.isBlank(acs.getLocation())) { throw new MessageDecodingException("Unable to resolve SP ACS URL location for binding " + SAMLConstants.SAML2_POST_BINDING_URI); shire = acs.getLocation();
acs.setLocation(foundAcs.getLocation()); acs.setResponseLocation(foundAcs.getResponseLocation()); acs.setIndex(acsIndex); throw new SamlException("AssertionConsumerService has no protocol binding defined"); if (StringUtils.isBlank(acs.getLocation()) && StringUtils.isBlank(acs.getResponseLocation())) { throw new SamlException("AssertionConsumerService has no location or response location defined");
val acs = adaptor.getAssertionConsumerService(binding); LOGGER.debug("Located assertion consumer service url [{}]", acs); val ecpResponse = newEcpResponse(acs.getLocation()); val header = newSoapObject(Header.class); header.getUnknownXMLObjects().add(ecpResponse);
request.setAssertionConsumerServiceIndex(assertionConsumerServiceIndex); } else { request.setAssertionConsumerServiceURL(assertionConsumerService.getLocation());