/** * Marshall the response type to the output stream * * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Marshall the response type to the output stream * * @param responseType * @param os * * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Convert a SAML2 Response into a Document * * @param responseType * @return * @throws ParserConfigurationException */ public Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(responseType); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); return DocumentUtil.getDocument(bis); }
/** * Marshall the response type to the output stream * * @param responseType * @param os * * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Marshall the ResponseType into a writer * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Marshall the response type to the output stream * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Marshall the ResponseType into a writer * * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Marshall the ResponseType into a writer * * @param responseType * @param writer * * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Convert a SAML2 Response into a Document * @param responseType * @return * @throws ParserConfigurationException */ public Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(responseType); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); return DocumentUtil.getDocument(bis); }
/** * Marshall the ResponseType into a writer * * @param responseType * @param writer * * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Convert a SAML2 Response into a Document * * @param responseType * * @return * * @throws ProcessingException * @throws ParsingException * @throws ConfigurationException */ public Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(responseType); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); return DocumentUtil.getDocument(bis); }
/** * Convert a SAML2 Response into a Document * * @param responseType * * @return * * @throws ProcessingException * @throws ParsingException * @throws ConfigurationException */ public Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(responseType); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); return DocumentUtil.getDocument(bis); }
public Source invoke(Source request) { try { Document doc = (Document) DocumentUtil.getNodeFromSource(request); if (logger.isTraceEnabled()) { logger.trace("XACML Received Message: " + DocumentUtil.asString(doc)); } XACMLAuthzDecisionQueryType xacmlQuery = SOAPSAMLXACMLUtil.getXACMLQueryType(doc); ResponseType samlResponseType = SOAPSAMLXACMLUtil.handleXACMLQuery(pdp, issuer, xacmlQuery); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos); SAMLResponseWriter samlResponseWriter = new SAMLResponseWriter(xmlStreamWriter); samlResponseWriter.write(samlResponseType); Document responseDocument = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); return new DOMSource(responseDocument.getDocumentElement()); } catch (Exception e) { throw logger.xacmlPDPMessageProcessingError(e); } }
public Source invoke(Source request) { try { Document doc = (Document) DocumentUtil.getNodeFromSource(request); if (logger.isTraceEnabled()) { logger.trace("XACML Received Message: " + DocumentUtil.asString(doc)); } XACMLAuthzDecisionQueryType xacmlQuery = SOAPSAMLXACMLUtil.getXACMLQueryType(doc); ResponseType samlResponseType = SOAPSAMLXACMLUtil.handleXACMLQuery(pdp, issuer, xacmlQuery); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos); SAMLResponseWriter samlResponseWriter = new SAMLResponseWriter(xmlStreamWriter); samlResponseWriter.write(samlResponseType); Document responseDocument = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); return new DOMSource(responseDocument.getDocumentElement()); } catch (Exception e) { throw logger.xacmlPDPMessageProcessingError(e); } }
public Source invoke(Source request) { try { Document doc = (Document) DocumentUtil.getNodeFromSource(request); if (logger.isTraceEnabled()) { logger.trace("XACML Received Message: " + DocumentUtil.asString(doc)); } XACMLAuthzDecisionQueryType xacmlQuery = SOAPSAMLXACMLUtil.getXACMLQueryType(doc); ResponseType samlResponseType = SOAPSAMLXACMLUtil.handleXACMLQuery(pdp, issuer, xacmlQuery); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos); SAMLResponseWriter samlResponseWriter = new SAMLResponseWriter(xmlStreamWriter); samlResponseWriter.write(samlResponseType); Document responseDocument = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray())); return new DOMSource(responseDocument.getDocumentElement()); } catch (Exception e) { throw logger.xacmlPDPMessageProcessingError(e); } }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * @param statusCodeType * @param out * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }
/** * Write a {@code StatusCodeType} to stream * * @param statusCodeType * @param out * * @throws ProcessingException */ public void write(StatusCodeType statusCodeType) throws ProcessingException { StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, JBossSAMLConstants.STATUS_CODE.get(), PROTOCOL_NSURI.get()); URI value = statusCodeType.getValue(); if (value != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.VALUE.get(), value.toASCIIString()); } StatusCodeType subStatusCode = statusCodeType.getStatusCode(); if (subStatusCode != null) write(subStatusCode); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); }