Scoping scoping = scopingBuilder.buildObject(); scoping.getRequesterIDs().add(createRequesterID(spEntityIdBy)); authnRequest.setScoping(scoping); } else { LOG.warn("For Client {} there is no key CLIENT_SAML_ENTITY_NAME configured to identify the SP entity name. NO SCOPING IS APPLIED", client.getClientId());
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AuthnRequest req = (AuthnRequest) parentSAMLObject; if (childSAMLObject instanceof Subject) { req.setSubject((Subject) childSAMLObject); } else if (childSAMLObject instanceof NameIDPolicy) { req.setNameIDPolicy((NameIDPolicy) childSAMLObject); } else if (childSAMLObject instanceof Conditions) { req.setConditions((Conditions) childSAMLObject); } else if (childSAMLObject instanceof RequestedAuthnContext) { req.setRequestedAuthnContext((RequestedAuthnContext) childSAMLObject); } else if (childSAMLObject instanceof Scoping) { req.setScoping((Scoping) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } } }
/** * Fills the request with information about scoping, including IDP in the scope IDP List. * * @param request request to fill * @param serviceURI destination to send the request to * @param options options driving generation of the element, contains list of allowed IDPs */ protected void buildScoping(AuthnRequest request, SingleSignOnService serviceURI, WebSSOProfileOptions options) { if (options.isIncludeScoping() != null && options.isIncludeScoping()) { Set<String> idpEntityNames = options.getAllowedIDPs(); IDPList idpList = buildIDPList(idpEntityNames, serviceURI); SAMLObjectBuilder<Scoping> scopingBuilder = (SAMLObjectBuilder<Scoping>) builderFactory.getBuilder(Scoping.DEFAULT_ELEMENT_NAME); Scoping scoping = scopingBuilder.buildObject(); scoping.setIDPList(idpList); scoping.setProxyCount(options.getProxyCount()); if (!CollectionUtils.isEmpty(options.getRequesterIds())) { RequesterIDBuilder requesterIDBuilder = new RequesterIDBuilder(); for (String id : options.getRequesterIds()) { RequesterID requesterID = requesterIDBuilder.buildObject(); requesterID.setRequesterID(id); scoping.getRequesterIDs().add(requesterID); } } request.setScoping(scoping); } }