Search in sources :

Example 1 with Request

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);
    }
}
Also used : QName(javax.xml.namespace.QName) Request(ddf.security.liberty.paos.Request)

Example 2 with Request

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);
}
Also used : RequestBuilder(ddf.security.liberty.paos.impl.RequestBuilder) AuthnRequest(org.opensaml.saml.saml2.core.AuthnRequest) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletRequest(javax.servlet.ServletRequest) Request(ddf.security.liberty.paos.Request)

Example 3 with Request

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);
    }
}
Also used : Request(ddf.security.liberty.paos.Request)

Aggregations

Request (ddf.security.liberty.paos.Request)3 RequestBuilder (ddf.security.liberty.paos.impl.RequestBuilder)1 ServletRequest (javax.servlet.ServletRequest)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 QName (javax.xml.namespace.QName)1 AuthnRequest (org.opensaml.saml.saml2.core.AuthnRequest)1