use of org.opensaml.soap.soap11.Header in project cas by apereo.
the class SamlProfileSamlSoap11FaultResponseBuilder method build.
@Override
public Envelope build(final AuthnRequest authnRequest, final HttpServletRequest request, final HttpServletResponse response, final org.jasig.cas.client.validation.Assertion casAssertion, final SamlRegisteredService service, final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) throws SamlException {
final Header header = newSoapObject(Header.class);
final Body body = newSoapObject(Body.class);
final Fault fault = newSoapObject(Fault.class);
final FaultCode faultCode = newSoapObject(FaultCode.class);
faultCode.setValue(FaultCode.SERVER);
fault.setCode(faultCode);
final FaultActor faultActor = newSoapObject(FaultActor.class);
faultActor.setValue(SamlIdPUtils.getIssuerFromSamlRequest(authnRequest));
fault.setActor(faultActor);
final FaultString faultString = newSoapObject(FaultString.class);
faultString.setValue(request.getAttribute(SamlIdPConstants.REQUEST_ATTRIBUTE_ERROR).toString());
fault.setMessage(faultString);
body.getUnknownXMLObjects().add(fault);
final Envelope envelope = newSoapObject(Envelope.class);
envelope.setHeader(header);
envelope.setBody(body);
encodeFinalResponse(request, response, service, adaptor, envelope);
return envelope;
}
use of org.opensaml.soap.soap11.Header in project okhttp by square.
the class HeadersTest method readNameValueBlockDropsForbiddenHeadersHttp2.
@Test
public void readNameValueBlockDropsForbiddenHeadersHttp2() throws IOException {
List<Header> headerBlock = headerEntries(":status", "200 OK", ":version", "HTTP/1.1", "connection", "close");
Request request = new Request.Builder().url("http://square.com/").build();
Response response = Http2Codec.readHttp2HeadersList(headerBlock).request(request).build();
Headers headers = response.headers();
assertEquals(1, headers.size());
assertEquals(":version", headers.name(0));
assertEquals("HTTP/1.1", headers.value(0));
}
use of org.opensaml.soap.soap11.Header in project ddf by codice.
the class SamlProtocol method createSoapMessage.
public static Envelope createSoapMessage(SignableSAMLObject signableSAMLObject) {
Body body = soapBodyBuilder.buildObject();
body.getUnknownXMLObjects().add(signableSAMLObject);
Envelope envelope = soapEnvelopeBuilder.buildObject();
envelope.setBody(body);
Header header = soapHeaderBuilder.buildObject();
envelope.setHeader(header);
return envelope;
}
use of org.opensaml.soap.soap11.Header in project cas by apereo.
the class SamlProfileSamlSoap11FaultResponseBuilder method build.
@Override
public Envelope build(final RequestAbstractType authnRequest, final HttpServletRequest request, final HttpServletResponse response, final Object casAssertion, final SamlRegisteredService service, final SamlRegisteredServiceServiceProviderMetadataFacade adaptor, final String binding) throws SamlException {
final Header header = newSoapObject(Header.class);
final Body body = newSoapObject(Body.class);
final Fault fault = newSoapObject(Fault.class);
final FaultCode faultCode = newSoapObject(FaultCode.class);
faultCode.setValue(FaultCode.SERVER);
fault.setCode(faultCode);
final FaultActor faultActor = newSoapObject(FaultActor.class);
faultActor.setValue(SamlIdPUtils.getIssuerFromSamlRequest(authnRequest));
fault.setActor(faultActor);
final FaultString faultString = newSoapObject(FaultString.class);
faultString.setValue(request.getAttribute(SamlIdPConstants.REQUEST_ATTRIBUTE_ERROR).toString());
fault.setMessage(faultString);
body.getUnknownXMLObjects().add(fault);
final Envelope envelope = newSoapObject(Envelope.class);
envelope.setHeader(header);
envelope.setBody(body);
encodeFinalResponse(request, response, service, adaptor, envelope, binding, authnRequest, casAssertion);
return envelope;
}
use of org.opensaml.soap.soap11.Header in project okhttp by square.
the class Case method getHeaders.
public List<Header> getHeaders() {
List<Header> result = new ArrayList<>();
for (Map<String, String> inputHeader : headers) {
Map.Entry<String, String> entry = inputHeader.entrySet().iterator().next();
result.add(new Header(entry.getKey(), entry.getValue()));
}
return result;
}
Aggregations