public SAMLResponseWriter(XMLStreamWriter writer) { super(writer); this.assertionWriter = new SAMLAssertionWriter(writer); }
public SAMLResponseWriter(XMLStreamWriter writer) { super(writer); this.assertionWriter = new SAMLAssertionWriter(writer); }
public SAMLResponseWriter(XMLStreamWriter writer) { super(writer); this.assertionWriter = new SAMLAssertionWriter(writer); }
public SAMLResponseWriter(XMLStreamWriter writer) { super(writer); this.assertionWriter = new SAMLAssertionWriter(writer); }
public SAMLResponseWriter(XMLStreamWriter writer) { super(writer); this.assertionWriter = new SAMLAssertionWriter(writer); }
/** * Given {@code AssertionType}, convert it into a String * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * * @param assertion * * @return * * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * * @param assertion * * @return * * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * <p> * Utility method that marshals the specified {@code AssertionType} object into an {@code Element} instance. * </p> * * @param assertion * an {@code AssertionType} object representing the SAML assertion to be marshaled. * @return a reference to the {@code Element} that contains the marshaled SAML assertion. * @throws Exception * if an error occurs while marshaling the assertion. */ public static Element toElement(AssertionType assertion) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); Document document = DocumentUtil.getDocument(bis); if (trace) { log.trace("Written Assertion=" + DocumentUtil.asString(document)); } return document.getDocumentElement(); }
/** * Given {@code AssertionType}, convert it into a DOM Document. * * @param assertion * @return * @throws ProcessingException */ public static Document asDocument(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); try { return DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
/** * <p> * Utility method that marshals the specified {@code AssertionType} object into an {@code Element} instance. * </p> * * @param assertion * an {@code AssertionType} object representing the SAML assertion to be marshaled. * @return a reference to the {@code Element} that contains the marshaled SAML assertion. * @throws Exception * if an error occurs while marshaling the assertion. */ public static Element toElement(AssertionType assertion) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); Document document = DocumentUtil.getDocument(bis); if (trace) { log.trace("Written Assertion=" + DocumentUtil.asString(document)); } return document.getDocumentElement(); }
/** * Given {@code AssertionType}, convert it into a DOM Document. * * @param assertion * * @return * * @throws ProcessingException */ public static Document asDocument(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); try { return DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
/** * Given {@code AssertionType}, convert it into a DOM Document. * * @param assertion * * @return * * @throws ProcessingException */ public static Document asDocument(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); try { return DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); } catch (Exception e) { throw logger.processingError(e); } }
/** * <p> * Utility method that marshals the specified {@code AssertionType} object into an {@code Element} instance. * </p> * * @param assertion an {@code AssertionType} object representing the SAML assertion to be marshaled. * @return a reference to the {@code Element} that contains the marshaled SAML assertion. * @throws Exception if an error occurs while marshaling the assertion. */ public static Element toElement(AssertionType assertion) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); byte[] assertionBytes = baos.toByteArray(); ByteArrayInputStream bis = new ByteArrayInputStream(assertionBytes); Document document = DocumentUtil.getDocument(bis); if (logger.isTraceEnabled()) { logger.samlAssertion(DocumentUtil.asString(document)); } return document.getDocumentElement(); }
/** * <p> * Utility method that marshals the specified {@code AssertionType} object into an {@code Element} instance. * </p> * * @param assertion an {@code AssertionType} object representing the SAML assertion to be marshaled. * * @return a reference to the {@code Element} that contains the marshaled SAML assertion. * * @throws Exception if an error occurs while marshaling the assertion. */ public static Element toElement(AssertionType assertion) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); byte[] assertionBytes = baos.toByteArray(); ByteArrayInputStream bis = new ByteArrayInputStream(assertionBytes); Document document = DocumentUtil.getDocument(bis); if (logger.isTraceEnabled()) { logger.samlAssertion(DocumentUtil.asString(document)); } return document.getDocumentElement(); }
private void writeRenewTargetType(RenewTargetType renewTarget) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.RENEW_TARGET, BASE_NAMESPACE); List<Object> list = renewTarget.getAny(); for (Object renewTargetObj : list) { if (renewTargetObj instanceof AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw logger.writerUnknownTypeError(renewTargetObj.getClass().getName()); } /* * Object renewTargetObj = renewTarget.getAny(); if (renewTargetObj != null) { if (renewTargetObj instanceof * AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = * new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof * Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw new * ProcessingException("Unknown renew target type=" + renewTargetObj.getClass().getName()); } */ StaxUtil.writeEndElement(writer); }
private void writeRenewTargetType(RenewTargetType renewTarget) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.RENEW_TARGET, BASE_NAMESPACE); List<Object> list = renewTarget.getAny(); for (Object renewTargetObj : list) { if (renewTargetObj instanceof AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw logger.writerUnknownTypeError(renewTargetObj.getClass().getName()); } /* * Object renewTargetObj = renewTarget.getAny(); if (renewTargetObj != null) { if (renewTargetObj instanceof * AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = * new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof * Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw new * ProcessingException("Unknown renew target type=" + renewTargetObj.getClass().getName()); } */ StaxUtil.writeEndElement(writer); }
private void writeRenewTargetType(RenewTargetType renewTarget) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.RENEW_TARGET, BASE_NAMESPACE); List<Object> list = renewTarget.getAny(); for (Object renewTargetObj : list) { if (renewTargetObj instanceof AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw logger.writerUnknownTypeError(renewTargetObj.getClass().getName()); } /* * Object renewTargetObj = renewTarget.getAny(); if (renewTargetObj != null) { if (renewTargetObj instanceof * AssertionType) { AssertionType assertion = (AssertionType) renewTargetObj; SAMLAssertionWriter samlAssertionWriter = * new SAMLAssertionWriter(this.writer); samlAssertionWriter.write(assertion); } else if (renewTargetObj instanceof * Element) { StaxUtil.writeDOMElement(writer, (Element) renewTargetObj); } else throw new * ProcessingException("Unknown renew target type=" + renewTargetObj.getClass().getName()); } */ StaxUtil.writeEndElement(writer); }