use of ddf.security.liberty.paos.Request in project ddf by codice.
the class RequestUnmarshaller method processAttribute.
/**
* {@inheritDoc}
*/
protected void processAttribute(@Nonnull XMLObject samlObject, @Nonnull Attr attribute) throws UnmarshallingException {
Request request = (Request) samlObject;
QName attrName = QNameSupport.getNodeQName(attribute);
if (Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME.equals(attrName)) {
request.setSOAP11MustUnderstand(XSBooleanValue.valueOf(attribute.getValue()));
} else if (Request.SOAP11_ACTOR_ATTR_NAME.equals(attrName)) {
request.setSOAP11Actor(attribute.getValue());
} else if (Request.RESPONSE_CONSUMER_URL_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setResponseConsumerURL(attribute.getValue());
} else if (Request.SERVICE_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setService(attribute.getValue());
} else if (Request.MESSAGE_ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setMessageID(attribute.getValue());
} else {
super.processAttribute(samlObject, attribute);
}
}
use of ddf.security.liberty.paos.Request in project ddf by codice.
the class IdpHandler method createPaosRequest.
private String createPaosRequest(HttpServletRequest request) throws WSSecurityException {
String spIssuerId = getSpIssuerId();
String spAssertionConsumerServiceUrl = getSpAssertionConsumerServiceUrl(spIssuerId);
RequestBuilder requestBuilder = new RequestBuilder();
Request paosRequest = requestBuilder.buildObject();
paosRequest.setResponseConsumerURL(spAssertionConsumerServiceUrl);
paosRequest.setMessageID(createRelayState(request));
paosRequest.setService(Request.ECP_SERVICE);
paosRequest.setSOAP11MustUnderstand(true);
paosRequest.setSOAP11Actor(HTTP_SCHEMAS_XMLSOAP_ORG_SOAP_ACTOR_NEXT);
return convertXmlObjectToString(paosRequest);
}
use of ddf.security.liberty.paos.Request in project ddf by codice.
the class RequestMarshaller method marshallAttributes.
/**
* {@inheritDoc}
*/
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
Request request = (Request) xmlObject;
if (request.getResponseConsumerURL() != null) {
domElement.setAttributeNS(null, Request.RESPONSE_CONSUMER_URL_ATTRIB_NAME, request.getResponseConsumerURL());
}
if (request.getService() != null) {
domElement.setAttributeNS(null, Request.SERVICE_ATTRIB_NAME, request.getService());
}
if (request.getMessageID() != null) {
domElement.setAttributeNS(null, Request.MESSAGE_ID_ATTRIB_NAME, request.getMessageID());
}
XMLObjectSupport.marshallAttribute(Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME, Optional.ofNullable(request.isSOAP11MustUnderstandXSBoolean()).orElse(XSBooleanValue.valueOf("false")).toString(), domElement, false);
if (request.getSOAP11Actor() != null) {
XMLObjectSupport.marshallAttribute(Request.SOAP11_ACTOR_ATTR_NAME, request.getSOAP11Actor(), domElement, false);
}
}
Aggregations