Examples of SAML11AssertionWriter


Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

     * @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(SAML11AssertionType assertion) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAML11AssertionWriter writer = new SAML11AssertionWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(assertion);

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
        Document document = DocumentUtil.getDocument(bis);

        return document.getDocumentElement();
View Full Code Here

Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

        URI confirmationMethod = subjectConfirm.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:bearer", confirmationMethod.toString());

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

Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

        assertTrue(attribValues.contains("member"));
        assertTrue(attribValues.contains("student"));

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

Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

        assertEquals(XMLTimeUtil.parse("2002-06-19T17:05:37.795Z"), conditions.getNotBefore());
        assertEquals(XMLTimeUtil.parse("2002-06-19T17:15:37.795Z"), conditions.getNotOnOrAfter());

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

Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

        confirmationMethod = subjConf.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:artifact", confirmationMethod.toString());

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

Examples of org.picketlink.identity.federation.core.saml.v1.writers.SAML11AssertionWriter

        Element sig = assertion.getSignature();
        assertNotNull(sig);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAML11AssertionWriter writer = new SAML11AssertionWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(assertion);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAML11AssertionParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.