Package org.opensaml.saml2.metadata

Examples of org.opensaml.saml2.metadata.Endpoint


     * @return response URL from the relying party endpoint
     *
     * @throws MessageEncodingException throw if no relying party endpoint is available
     */
    protected String getEndpointURL(SAMLMessageContext messageContext) throws MessageEncodingException {
        Endpoint endpoint = messageContext.getPeerEntityEndpoint();
        if (endpoint == null) {
            throw new MessageEncodingException("Endpoint for relying party was null.");
        }

        if (messageContext.getOutboundMessage() instanceof Response
                && !DatatypeHelper.isEmpty(endpoint.getResponseLocation())) {
            return endpoint.getResponseLocation();
        } else {
            if (DatatypeHelper.isEmpty(endpoint.getLocation())) {
                throw new MessageEncodingException("Relying party endpoint location was null or empty.");
            }
            return endpoint.getLocation();
        }
    }
View Full Code Here


        List<? extends Endpoint> endpoints = getEntityRoleMetadata().getEndpoints(getEndpointType());
        if (endpoints == null || endpoints.size() == 0) {
            return null;
        }

        Endpoint selectedEndpoint;
        endpoints = filterEndpointsByProtocolBinding(endpoints);
        if (endpoints.get(0) instanceof IndexedEndpoint) {
            selectedEndpoint = selectIndexedEndpoint((List<IndexedEndpoint>) endpoints);
        } else {
            selectedEndpoint = selectNonIndexedEndpoint((List<Endpoint>) endpoints);
        }
       
        log.debug("Selected endpoint {} for request", selectedEndpoint.getLocation());
        return selectedEndpoint;
    }
View Full Code Here

     * @return filtered endpoints
     */
    protected List<? extends Endpoint> filterEndpointsByProtocolBinding(List<? extends Endpoint> endpoints) {
        List<Endpoint> filteredEndpoints = new ArrayList<Endpoint>(endpoints);
        Iterator<Endpoint> endpointItr = filteredEndpoints.iterator();
        Endpoint endpoint;
        while (endpointItr.hasNext()) {
            endpoint = endpointItr.next();
            if (!getSupportedIssuerBindings().contains(endpoint.getBinding())) {
                endpointItr.remove();
                continue;
            }
        }

View Full Code Here

     *
     * @return appropriate endpoint from a list of non-indexed endpoints or null
     */
    protected Endpoint selectNonIndexedEndpoint(List<Endpoint> endpoints) {
        Iterator<Endpoint> endpointItr = endpoints.iterator();
        Endpoint endpoint;
        while (endpointItr.hasNext()) {
            endpoint = endpointItr.next();

            // Endpoint is first one of acceptable binding, return it.
            return endpoint;
View Full Code Here

        selector.getSupportedIssuerBindings().add(SAMLConstants.SAML2_SOAP11_BINDING_URI);
        selector.setMetadataProvider(requestContext.getMetadataProvider());
        selector.setEntityMetadata(requestContext.getLocalEntityMetadata());
        selector.setEntityRoleMetadata(requestContext.getLocalEntityRoleMetadata());

        Endpoint acsEndpoint = selector.selectEndpoint();

        if (acsEndpoint == null) {
            log.error("Unable to select source location for artifact.  No artifact resolution service defined for issuer.");
            return null;
        }
View Full Code Here

     * @return response URL from the relying party endpoint
     *
     * @throws MessageEncodingException throw if no relying party endpoint is available
     */
    protected String getEndpointURL(SAMLMessageContext messageContext) throws MessageEncodingException {
        Endpoint endpoint = messageContext.getPeerEntityEndpoint();
        if (endpoint == null) {
            throw new MessageEncodingException("Endpoint for relying party was null.");
        }

        if (messageContext.getOutboundMessage() instanceof Response
                && !DatatypeHelper.isEmpty(endpoint.getResponseLocation())) {
            return endpoint.getResponseLocation();
        } else {
            if (DatatypeHelper.isEmpty(endpoint.getLocation())) {
                throw new MessageEncodingException("Relying party endpoint location was null or empty.");
            }
            return endpoint.getLocation();
        }
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        Endpoint endpoint = (Endpoint) samlObject;
       
        if (attribute.getLocalName().equals(Endpoint.BINDING_ATTRIB_NAME)) {
            endpoint.setBinding(attribute.getValue());
        } else if (attribute.getLocalName().equals(Endpoint.LOCATION_ATTRIB_NAME)) {
            endpoint.setLocation(attribute.getValue());
        } else if (attribute.getLocalName().equals(Endpoint.RESPONSE_LOCATION_ATTRIB_NAME)) {
            endpoint.setResponseLocation(attribute.getValue());
        } else {
            QName attribQName = XMLHelper.getNodeQName(attribute);
            if (attribute.isId()) {
               endpoint.getUnknownAttributes().registerID(attribQName);
            }
            endpoint.getUnknownAttributes().put(attribQName, attribute.getValue());
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        Endpoint endpoint = (Endpoint) parentSAMLObject;

        endpoint.getUnknownXMLObjects().add(childSAMLObject);
    }
View Full Code Here

        selector.getSupportedIssuerBindings().add(SAMLConstants.SAML1_SOAP11_BINDING_URI);
        selector.setMetadataProvider(requestContext.getMetadataProvider());
        selector.setEntityMetadata(requestContext.getLocalEntityMetadata());
        selector.setEntityRoleMetadata(requestContext.getLocalEntityRoleMetadata());

        Endpoint acsEndpoint = selector.selectEndpoint();

        if (acsEndpoint == null) {
            log.error("Unable to select source location for artifact.  No artifact resolution service defined for issuer.");
            return null;
        }

        return acsEndpoint.getLocation();
    }
View Full Code Here

        List<? extends Endpoint> endpoints = getEntityRoleMetadata().getEndpoints(getEndpointType());
        if (endpoints == null || endpoints.size() == 0) {
            return null;
        }

        Endpoint endpoint = null;
        if (getSamlRequest() != null) {
            AuthnRequest request = (AuthnRequest) getSamlRequest();

            endpoints = filterEndpointsByProtocolBinding(endpoints);
            if (endpoints == null || endpoints.isEmpty()) {
View Full Code Here

TOP

Related Classes of org.opensaml.saml2.metadata.Endpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.