Examples of RequestAbstractType


Examples of org.opensaml.saml1.core.RequestAbstractType

    }

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

        if (childSAMLObject instanceof Signature) {
            request.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof RespondWith) {
            request.getRespondWiths().add((RespondWith) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml1.core.RequestAbstractType

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlElement, Attr attribute) throws UnmarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

        if (RequestAbstractType.ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
            request.setID(attribute.getValue());
        } else if (RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            DateTime cal = new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC());
            request.setIssueInstant(cal);
        } else if (RequestAbstractType.MINORVERSION_ATTRIB_NAME.equals(attribute.getLocalName())) {
            int minor;
            try {
                minor = Integer.parseInt(attribute.getValue());
            } catch (NumberFormatException n) {
                log.error("Unable to parse minor version string", n);
                throw new UnmarshallingException(n);
            }
            if (minor == 0) {
                request.setVersion(SAMLVersion.VERSION_10);
            } else if (minor == 1) {
                request.setVersion(SAMLVersion.VERSION_11);
            }
        } else {
            super.processAttribute(samlElement, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.saml1.core.RequestAbstractType

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

        if (request.getID() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, request.getID());
            if (request.getMinorVersion() != 0) {
                domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
            }
        }

        if (request.getIssueInstant() != null) {
            String date = Configuration.getSAMLDateFormatter().print(request.getIssueInstant());
            domElement.setAttributeNS(null, RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
        }
        if (request.getMinorVersion() != 0) {
            domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, "1");
            domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(request
                    .getMinorVersion()));
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

     */
    public static boolean validateAssertionSignature(String assertion, String alias,
                                                     String domainName) {
        boolean isSignatureValid = false;
        try {
            RequestAbstractType request = (RequestAbstractType) SAMLSSOUtil.unmarshall(SAMLSSOUtil.decode(assertion));
            isSignatureValid = validateAssertionSignature(request, alias, domainName);
        } catch (IdentityException ignore) {
            log.warn("Signature Validation failed for the SAML Assertion : Failed to unmarshall the SAML Assertion");
        }
        return isSignatureValid;
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

*/
public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        RequestAbstractType req = (RequestAbstractType) samlObject;

        if (req.getVersion() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
        }

        if (req.getID() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
            domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
        }

        if (req.getVersion() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
        }

        if (req.getIssueInstant() != null) {
            String iiStr = Configuration.getSAMLDateFormatter().print(req.getIssueInstant());
            domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
        }

        if (req.getDestination() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.DESTINATION_ATTRIB_NAME, req.getDestination());
        }

        if (req.getConsent() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

     * */
    protected String getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx) throws MessageDecodingException {
        SAMLObject samlMessage = samlMsgCtx.getInboundSAMLMessage();
        String messageDestination = null;
        if (samlMessage instanceof RequestAbstractType) {
            RequestAbstractType request =  (RequestAbstractType) samlMessage;
            messageDestination = DatatypeHelper.safeTrimOrNullString(request.getDestination());
        } else if (samlMessage instanceof StatusResponseType) {
            StatusResponseType response = (StatusResponseType) samlMessage;
            messageDestination = DatatypeHelper.safeTrimOrNullString(response.getDestination());
        } else {
            log.error("Invalid SAML message type encountered: {}", samlMessage.getElementQName().toString());
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

*/
public abstract class RequestAbstractTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        RequestAbstractType req = (RequestAbstractType) samlObject;

        if (attribute.getLocalName().equals(RequestAbstractType.VERSION_ATTRIB_NAME)) {
            req.setVersion(SAMLVersion.valueOf(attribute.getValue()));
        } else if (attribute.getLocalName().equals(RequestAbstractType.ID_ATTRIB_NAME)) {
            req.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            req.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
        } else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
            req.setDestination(attribute.getValue());
        } else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
            req.setConsent(attribute.getValue());
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

    }

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

        if (childSAMLObject instanceof Issuer) {
            req.setIssuer((Issuer) childSAMLObject);
        } else if (childSAMLObject instanceof Signature) {
            req.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof Extensions) {
            req.setExtensions((Extensions) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        RequestAbstractType req = (RequestAbstractType) samlObject;

        if (req.getVersion() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
        }

        if (req.getID() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
            domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
        }

        if (req.getVersion() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
        }

        if (req.getIssueInstant() != null) {
            String iiStr = Configuration.getSAMLDateFormatter().print(req.getIssueInstant());
            domElement.setAttributeNS(null, RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME, iiStr);
        }

        if (req.getDestination() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.DESTINATION_ATTRIB_NAME, req.getDestination());
        }

        if (req.getConsent() != null) {
            domElement.setAttributeNS(null, RequestAbstractType.CONSENT_ATTRIB_NAME, req.getConsent());
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.RequestAbstractType

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        RequestAbstractType req = (RequestAbstractType) samlObject;

        if (attribute.getLocalName().equals(RequestAbstractType.VERSION_ATTRIB_NAME)) {
            req.setVersion(SAMLVersion.valueOf(attribute.getValue()));
        } else if (attribute.getLocalName().equals(RequestAbstractType.ID_ATTRIB_NAME)) {
            req.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(RequestAbstractType.ISSUE_INSTANT_ATTRIB_NAME)
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            req.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
        } else if (attribute.getLocalName().equals(RequestAbstractType.DESTINATION_ATTRIB_NAME)) {
            req.setDestination(attribute.getValue());
        } else if (attribute.getLocalName().equals(RequestAbstractType.CONSENT_ATTRIB_NAME)) {
            req.setConsent(attribute.getValue());
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.