Package org.picketlink.identity.federation.core.saml.v2.interfaces

Examples of org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest


        LogoutRequestType lotRequest = (LogoutRequestType) parser.parse(configStream);
        assertNotNull(lotRequest);

        // Try out writing
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLRequestWriter writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(lotRequest);

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        DocumentUtil.getDocument(bis); // throws exceptions

        baos = new ByteArrayOutputStream();
        // Lets do the writing
        writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(lotRequest);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLSloRequestParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here


     * @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);
    }
View Full Code Here

            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);
View Full Code Here

        assertNotNull(status);
        assertEquals("urn:oasis:names:tc:SAML:2.0:status:Success", status.getStatusCode().getValue().toString());

        // Try out writing
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(artifactResponse);

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        Document doc = DocumentUtil.getDocument(bis); // throws exceptions
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        assertNotNull(status);
        assertEquals("urn:oasis:names:tc:SAML:2.0:status:Success", status.getStatusCode().getValue().toString());

        // Try out writing
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(artifactResponse);

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        Document doc = DocumentUtil.getDocument(bis); // throws exceptions
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        assertNotNull(xacmlStat.getRequest());
        assertNotNull(xacmlStat.getResponse());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLResponseParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

                throw new RuntimeException("Unknown statement type:" + statement);
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLResponseParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

        assertEquals("urn:oasis:names:tc:SAML:2.0:status:Responder", status.getStatusCode().getValue().toString());
        assertEquals("urn:oasis:names:tc:SAML:2.0:status:Success", status.getStatusCode().getStatusCode().getValue().toString());

        // Let us do some writing - currently only visual inspection. We will do proper validation later.
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response, new QName(PROTOCOL_NSURI.get(), LOGOUT_RESPONSE.get(), "samlp"));

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        DocumentUtil.getDocument(bis); // throws exceptions

        baos = new ByteArrayOutputStream();
        // Lets do the writing
        writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response, new QName(PROTOCOL_NSURI.get(), LOGOUT_RESPONSE.get(), "samlp"));
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLSloResponseParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

        refType = (AuthnContextDeclRefType) authnContext.getURIType().iterator().next();
        assertEquals("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", refType.getValue().toASCIIString());

        // Let us do some writing - currently only visual inspection. We will do proper validation later.
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response);

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        DocumentUtil.getDocument(bis); // throws exceptions

        baos = new ByteArrayOutputStream();
        // Lets do the writing
        writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLResponseParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

                throw new RuntimeException("attrib value not found");
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(response);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLResponseParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.