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

Examples of org.picketlink.identity.federation.core.saml.v2.writers.SAMLMetadataWriter


        assertEquals(XMLTimeUtil.parse("2010-09-30T19:13:37.869Z"), conditions.getNotBefore());
        assertEquals(XMLTimeUtil.parse("2010-09-30T21:13:37.869Z"), conditions.getNotOnOrAfter());

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


        AudienceRestrictionType audienceRestrictionType = (AudienceRestrictionType) conditions.getConditions().get(0);
        assertEquals(1, audienceRestrictionType.getAudience().size());
        assertEquals("http://services.testcorp.org/provider2", audienceRestrictionType.getAudience().get(0).toASCIIString());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(assertion);
        String writtenString = new String(baos.toByteArray());
        Logger.getLogger(SAMLAssertionParserTestCase.class).debug(writtenString);
        validateSchema(writtenString);
    }
View Full Code Here

        AudienceRestrictionType audienceRestrictionType = (AudienceRestrictionType) conditions.getConditions().get(0);
        assertEquals(1, audienceRestrictionType.getAudience().size());
        assertEquals("https://sp.example.com/SAML2", audienceRestrictionType.getAudience().get(0).toString());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos));
        writer.write(assertion);

        byte[] bytes = baos.toByteArray();
        ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
        DocumentUtil.getDocument(bis); // throws exceptions
View Full Code Here

            ByteArrayOutputStream baos = new ByteArrayOutputStream();

            XMLStreamWriter writer = StaxUtil.getXMLStreamWriter(baos);

            // write it back
            SAMLMetadataWriter mdWriter = new SAMLMetadataWriter(writer);
            mdWriter.writeEntitiesDescriptor(entities);

        }
    }
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        XMLStreamWriter writer = StaxUtil.getXMLStreamWriter(baos);

        // write it back
        SAMLMetadataWriter mdWriter = new SAMLMetadataWriter(writer);
        mdWriter.writeEntityDescriptor(entityDesc);

    }
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        XMLStreamWriter writer = StaxUtil.getXMLStreamWriter(baos);

        // write it back
        SAMLMetadataWriter mdWriter = new SAMLMetadataWriter(writer);
        mdWriter.writeEntityDescriptor(entity);

    }
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        XMLStreamWriter writer = StaxUtil.getXMLStreamWriter(baos);

        // write it back
        SAMLMetadataWriter mdWriter = new SAMLMetadataWriter(writer);
        mdWriter.writeEntityDescriptor(entity);
    }
View Full Code Here

        resp.setContentType(JBossSAMLConstants.METADATA_MIME.get());
        OutputStream os = resp.getOutputStream();

        try {
            XMLStreamWriter streamWriter = StaxUtil.getXMLStreamWriter(os);
            SAMLMetadataWriter writer = new SAMLMetadataWriter(streamWriter);
            writer.writeEntityDescriptor(metadata);
        } catch (ProcessingException e) {
            throw new ServletException(e);
        }
        /*
         * JAXBElement<?> jaxbEl = MetaDataBuilder.getObjectFactory().createEntityDescriptor(metadata); try {
View Full Code Here

    public static String toString(EntityDescriptorType edt) {
        StringWriter sw = new StringWriter();
        try {
            XMLStreamWriter writer = StaxUtil.getXMLStreamWriter(sw);

            SAMLMetadataWriter metaWriter = new SAMLMetadataWriter(writer);
            metaWriter.writeEntityDescriptor(edt);
        } catch (ProcessingException e) {
            throw new RuntimeException(e);
        }

        return sw.toString();
View Full Code Here

    public void persist(EntityDescriptorType entity, String id) throws IOException {
        File persistedFile = validateIdAndReturnMDFile(id);

        try {
            XMLStreamWriter streamWriter = StaxUtil.getXMLStreamWriter(new FileOutputStream(persistedFile));
            SAMLMetadataWriter writer = new SAMLMetadataWriter(streamWriter);

            writer.writeEntityDescriptor(entity);
        } catch (ProcessingException e) {
            throw new RuntimeException(e);
        }
       
        logger.trace("Persisted entity descriptor into " + persistedFile.getPath());
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.saml.v2.writers.SAMLMetadataWriter

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.