private static AssertionConsumerService getAssertionConsumerServiceFromRequest(final RequestAbstractType authnRequest, final String binding) { if (authnRequest instanceof AuthnRequest) { val acsUrl = AuthnRequest.class.cast(authnRequest).getAssertionConsumerServiceURL(); if (StringUtils.isBlank(acsUrl)) { return null; } LOGGER.debug("Using assertion consumer service url [{}] with binding [{}] from authentication request", acsUrl, binding); val builder = new AssertionConsumerServiceBuilder(); val endpoint = builder.buildObject(AssertionConsumerService.DEFAULT_ELEMENT_NAME); endpoint.setBinding(binding); endpoint.setResponseLocation(acsUrl); endpoint.setLocation(acsUrl); return endpoint; } return null; }
if (req.getAssertionConsumerServiceURL() != null) { domElement.setAttributeNS(null, AuthnRequest.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME, req .getAssertionConsumerServiceURL());
public SAMLAuthnRequest(AuthnRequest authnRequest) { super(authnRequest); consumerServiceURL = authnRequest.getAssertionConsumerServiceURL(); forceAuthn = authnRequest.isForceAuthn().booleanValue(); if (authnRequest.getSubject() != null && authnRequest.getSubject().getNameID() != null) { subjectNameId = authnRequest.getSubject().getNameID().getValue(); } }
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); } } }
log.debug("{} Populating template endpoint for resolution from SAML AuthnRequest", getLogPrefix()); endpoint.setLocation(((AuthnRequest) inboundMessage).getAssertionConsumerServiceURL()); endpoint.setBinding(((AuthnRequest) inboundMessage).getProtocolBinding()); if (endpoint instanceof IndexedEndpoint) {
} else { acs.setBinding(authnRequest.getProtocolBinding()); acs.setLocation(authnRequest.getAssertionConsumerServiceURL()); acs.setResponseLocation(authnRequest.getAssertionConsumerServiceURL()); acs.setIndex(0); acs.setIsDefault(Boolean.TRUE);
.setAssertionConsumerService( getEndpoint( request.getAssertionConsumerServiceURL(), Binding.fromUrn(request.getProtocolBinding()), ofNullable(request.getAssertionConsumerServiceIndex()).orElse(-1),