private static AssertionConsumerService buildAssertionConsumerServiceElement( SamlAssertionConsumerConfig config, SamlPortConfig portConfig, String hostname, int index) { final AssertionConsumerService consumer = build(AssertionConsumerService.DEFAULT_ELEMENT_NAME); consumer.setLocation(config.endpoint().toUriString(portConfig.scheme().uriText(), hostname, portConfig.port())); consumer.setBinding(config.endpoint().bindingProtocol().urn()); consumer.setIndex(index); // Add 'isDefault' attribute only when told so. if (config.isDefault()) { consumer.setIsDefault(true); } return consumer; }
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; }
protected AssertionConsumerService getAssertionConsumerService(final String binding, final int index, final boolean isDefault) { final SAMLObjectBuilder<AssertionConsumerService> builder = (SAMLObjectBuilder<AssertionConsumerService>) this.builderFactory .getBuilder(AssertionConsumerService.DEFAULT_ELEMENT_NAME); final AssertionConsumerService consumer = builder.buildObject(); consumer.setLocation(this.assertionConsumerServiceUrl); consumer.setBinding(binding); if (isDefault) { consumer.setIsDefault(true); } consumer.setIndex(index); return consumer; }
/** * Create the set of criteria used to find a unique CAS service given a CAS service URL. * * @param serviceURL CAS service URL. * * @return Metadata resolver criteria set. */ @Nonnull protected CriteriaSet criteria(@Nonnull final String serviceURL) { final AssertionConsumerService loginACS = new AssertionConsumerServiceBuilder().buildObject(); loginACS.setBinding(LOGIN_BINDING); loginACS.setLocation(serviceURL); return new CriteriaSet( new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME), new EndpointCriterion<>(loginACS), new ProtocolCriterion(AbstractProtocolConfiguration.PROTOCOL_URI), new StartsWithLocationCriterion()); }
public AssertionConsumerService getAssertionConsumerService(Endpoint endpoint, int index) { SAMLObjectBuilder<AssertionConsumerService> builder = (SAMLObjectBuilder<AssertionConsumerService>) getBuilderFactory() .getBuilder(AssertionConsumerService.DEFAULT_ELEMENT_NAME); AssertionConsumerService consumer = builder.buildObject(); consumer.setLocation(endpoint.getLocation()); consumer.setBinding(endpoint.getBinding().toString()); consumer.setIsDefault(endpoint.isDefault()); consumer.setIndex(index); return consumer; }
acs.setLocation(foundAcs.getLocation()); acs.setResponseLocation(foundAcs.getResponseLocation()); acs.setIndex(acsIndex); } else { acs.setBinding(authnRequest.getProtocolBinding()); acs.setLocation(authnRequest.getAssertionConsumerServiceURL()); acs.setResponseLocation(authnRequest.getAssertionConsumerServiceURL()); acs.setIndex(0);
assertionConsumerService.setBinding(REDIRECT_BINDING); assertionConsumerService.setIndex(acsIndex++); assertionConsumerService.setLocation(assertionConsumerServiceLocationRedirect); spSsoDescriptor.getAssertionConsumerServices().add(assertionConsumerService); assertionConsumerService.setBinding(POST_BINDING); assertionConsumerService.setIndex(acsIndex++); assertionConsumerService.setLocation(assertionConsumerServiceLocationPost); spSsoDescriptor.getAssertionConsumerServices().add(assertionConsumerService); assertionConsumerServicePaos.setBinding(PAOS_BINDING); assertionConsumerServicePaos.setIndex(acsIndex); assertionConsumerServicePaos.setLocation(assertionConsumerServiceLocationPaos); spSsoDescriptor.getAssertionConsumerServices().add(assertionConsumerServicePaos);
private static AssertionConsumerService buildAssertionConsumerServiceElement( SamlAssertionConsumerConfig config, SamlPortConfig portConfig, String hostname, int index) { final AssertionConsumerService consumer = build(AssertionConsumerService.DEFAULT_ELEMENT_NAME); consumer.setLocation(config.endpoint().toUriString(portConfig.scheme().uriText(), hostname, portConfig.port())); consumer.setBinding(config.endpoint().bindingProtocol().urn()); consumer.setIndex(index); // Add 'isDefault' attribute only when told so. if (config.isDefault()) { consumer.setIsDefault(true); } return consumer; }
assertionConsumerService.setIndex(bindingType.ordinal()); assertionConsumerService.setBinding(bindingType.getUri()); assertionConsumerService.setLocation(getAssertionConsumerURL(spEntityID, urlContext)); spSSODescriptor.getAssertionConsumerServices().add(assertionConsumerService); spEntityDescriptor.getRoleDescriptors().add(spSSODescriptor);