/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { ResponseAbstractType response = (ResponseAbstractType) samlElement; if (response.getID() != null) { domElement.setAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, response.getID()); if (response.getVersion() != SAMLVersion.VERSION_10) { domElement.setIdAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, true); } } if (response.getInResponseTo() != null) { domElement.setAttributeNS(null, ResponseAbstractType.INRESPONSETO_ATTRIB_NAME, response.getInResponseTo()); } if (response.getIssueInstant() != null) { String date = SAMLConfigurationSupport.getSAMLDateFormatter().print(response.getIssueInstant()); domElement.setAttributeNS(null, ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME, date); } domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, Integer.toString(response.getVersion().getMajorVersion())); domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(response.getVersion().getMinorVersion())); if (response.getRecipient() != null) { domElement.setAttributeNS(null, ResponseAbstractType.RECIPIENT_ATTRIB_NAME, response.getRecipient()); } }
response.setID(attribute.getValue()); } else if (attribute.getLocalName().equals(ResponseAbstractType.INRESPONSETO_ATTRIB_NAME)) { response.setInResponseTo(attribute.getValue()); } else if (attribute.getLocalName().equals(ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME) && !Strings.isNullOrEmpty(attribute.getValue())) { response.setIssueInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC())); } else if (attribute.getLocalName().equals(ResponseAbstractType.MAJORVERSION_ATTRIB_NAME)) { int major; response.setVersion(SAMLVersion.VERSION_10); } else if (minor == 1) { response.setVersion(SAMLVersion.VERSION_11); response.setRecipient(attribute.getValue()); } else { super.processAttribute(samlObject, attribute);
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { ResponseAbstractType response = (ResponseAbstractType) parentSAMLObject; if (childSAMLObject instanceof Signature) { response.setSignature((Signature) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** {@inheritDoc} */ public XMLObject unmarshall(Element domElement) throws UnmarshallingException { // After regular unmarshalling, check the minor version and set ID-ness if not SAML 1.0 ResponseAbstractType response = (ResponseAbstractType) super.unmarshall(domElement); if (response.getVersion() != SAMLVersion.VERSION_10 && !Strings.isNullOrEmpty(response.getID())) { domElement.setIdAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, true); } return response; }
/** * Sets the destination attribute on the outbound message if it is a * {@link org.opensaml.saml.saml1.core.ResponseAbstractType} message. * * @param outboundMessage outbound SAML message * @param endpointURL destination endpoint */ public static void setSAML1ResponseRecipient(@Nonnull final SAMLObject outboundMessage, @Nonnull @NotEmpty final String endpointURL) { if (outboundMessage instanceof org.opensaml.saml.saml1.core.ResponseAbstractType) { ((org.opensaml.saml.saml1.core.ResponseAbstractType) outboundMessage).setRecipient(endpointURL); } }
/** {@inheritDoc} */ @Override @Nullable public String apply(@Nullable final ProfileRequestContext input) { final SAMLObject response = responseLookupStrategy.apply(input); if (response != null) { if (response instanceof ResponseAbstractType) { return ((ResponseAbstractType) response).getInResponseTo(); } else if (response instanceof StatusResponseType) { return ((StatusResponseType) response).getInResponseTo(); } } return null; }
org.opensaml.saml.saml1.core.ResponseAbstractType response = (org.opensaml.saml.saml1.core.ResponseAbstractType) samlMessage; return response.getIssueInstant();
org.opensaml.saml.saml1.core.ResponseAbstractType response = (org.opensaml.saml.saml1.core.ResponseAbstractType) samlMessage; return response.getID();
org.opensaml.saml.saml1.core.ResponseAbstractType response = (org.opensaml.saml.saml1.core.ResponseAbstractType) samlMessage; messageDestination = StringSupport.trimOrNull(response.getRecipient());
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) { if (response instanceof ResponseAbstractType) { ((ResponseAbstractType) response).setInResponseTo(requestId); } else if (response instanceof StatusResponseType) { ((StatusResponseType) response).setInResponseTo(requestId); } else { log.debug("{} Message type {} is not supported", getLogPrefix(), response.getElementQName()); ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX); } }
final SAMLVersion version = ((ResponseAbstractType) message).getVersion(); if (version.getMajorVersion() != 1) { throw new MessageHandlerException("Request major version was invalid");