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

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


        List<Object> list = cancelTarget.getAny();

        for (Object cancelTargetObj : list) {
            if (cancelTargetObj instanceof AssertionType) {
                AssertionType assertion = (AssertionType) cancelTargetObj;
                SAMLAssertionWriter samlAssertionWriter = new SAMLAssertionWriter(this.writer);
                samlAssertionWriter.write(assertion);
            } else if (cancelTargetObj instanceof Element) {
                StaxUtil.writeDOMElement(writer, (Element) cancelTargetObj);
            } else
                throw logger.writerUnknownTypeError(cancelTargetObj.getClass().getName());
        }
View Full Code Here


                    WSTrustConstants.BASE_NAMESPACE);
            List<Object> theList = response.getRequestedSecurityToken().getAny();
            for (Object securityToken : theList) {
                if (securityToken instanceof AssertionType) {
                    AssertionType assertion = (AssertionType) securityToken;
                    SAMLAssertionWriter samlAssertionWriter = new SAMLAssertionWriter(this.writer);
                    samlAssertionWriter.write(assertion);
                } else if (securityToken instanceof Element) {
                    StaxUtil.writeDOMElement(this.writer, (Element) securityToken);
                } else
                    throw logger.writerUnknownTypeError(securityToken.getClass().getName());
            }
View Full Code Here

        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

     * @throws ConfigurationException
     */
    public Document convert(RequestAbstractType rat) throws ProcessingException, ConfigurationException, ParsingException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        SAMLRequestWriter writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(bos));
        if (rat instanceof AuthnRequestType) {
            writer.write((AuthnRequestType) rat);
        } else if (rat instanceof LogoutRequestType) {
            writer.write((LogoutRequestType) rat);
        }

        return DocumentUtil.getDocument(new String(bos.toByteArray()));
    }
View Full Code Here

TOP

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

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.