Examples of PicketLinkType


Examples of org.picketlink.config.federation.PicketLinkType

    public T getValue() throws IllegalStateException, IllegalArgumentException {
        return (T) this;
    }

    private PicketLinkType createPicketLinkType(C configuration) {
        PicketLinkType picketLinkType = new PicketLinkType();

        picketLinkType.setStsType(createSTSType());
        picketLinkType.setHandlers(new Handlers());
        picketLinkType.setEnableAudit(true);

        picketLinkType.setIdpOrSP((ProviderType) configuration);

        return picketLinkType;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

    public static final String ENABLE_AUDIT = "EnableAudit";

    @Override
    public Object parse(XMLEventReader xmlEventReader) throws ParsingException {
        PicketLinkType picketLinkType = new PicketLinkType();
        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, PICKETLINK);

        // parse and set the root element attributes.
        QName attributeQName = new QName("", ENABLE_AUDIT);
        Attribute attribute = startElement.getAttributeByName(attributeQName);
        if (attribute != null) {
            picketLinkType.setEnableAudit(Boolean.parseBoolean(StaxParserUtil.getAttributeValue(attribute)));
        }

        startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
        String tag = StaxParserUtil.getStartElementName(startElement);
        while (xmlEventReader.hasNext()) {
            if (SAMLConfigParser.IDP.equals(tag)) {
                SAMLConfigParser samlConfigParser = new SAMLConfigParser();
                ProviderType idp = (ProviderType) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setIdpOrSP(idp);
            } else if (SAMLConfigParser.SP.equals(tag)) {
                SAMLConfigParser samlConfigParser = new SAMLConfigParser();
                ProviderType sp = (ProviderType) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setIdpOrSP(sp);
            } else if (SAMLConfigParser.HANDLERS.equals(tag)) {
                SAMLConfigParser samlConfigParser = new SAMLConfigParser();
                Handlers handlers = (Handlers) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setHandlers(handlers);
            } else if (STSConfigParser.ROOT_ELEMENT.equals(tag)) {
                STSConfigParser samlConfigParser = new STSConfigParser();
                STSType sts = (STSType) samlConfigParser.parse(xmlEventReader);
                picketLinkType.setStsType(sts);
            }
            startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
            if (startElement == null)
                break;
            tag = StaxParserUtil.getStartElementName(startElement);
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

   
    public static PicketLinkType getConfiguration(InputStream is) throws ParsingException {
        if (is == null)
            throw logger.nullArgumentError("inputstream");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        PicketLinkType picketLinkType = (PicketLinkType) parser.parse(is);
        return picketLinkType;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

            throw logger.nullArgumentError("InputStream");
        }
       
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
       
        PicketLinkType parsedObject = (PicketLinkType) parser.parse(is);
       
        if (parsedObject.getIdpOrSP() instanceof IDPType)
            configParsedIDPType = (IDPType) parsedObject.getIdpOrSP();
        else
            configParsedSPType = (SPType) parsedObject.getIdpOrSP();
       
        this.configParsedPicketLinkType = parsedObject;
       
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

        return handler;
    }

    @Override
    public PicketLinkType getPicketLinkConfiguration() throws ProcessingException {
        PicketLinkType picketLinkType = new PicketLinkType();
       
        picketLinkType.setIdpOrSP(this.providerType);
       
        picketLinkType.setHandlers(new Handlers());

        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler"));
        picketLinkType.getHandlers().add(createHandler("org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureGenerationHandler"));

        return picketLinkType;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-idp.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        IDPType idp = (IDPType) picketlink.getIdpOrSP();
        assertNotNull(idp);
        assertTrue(picketlink.isEnableAudit());
       
        // asserts the StrictPostBinding attribute. Default is true, but for this test it was changed to true in the configuration file.
        assertFalse(idp.isStrictPostBinding());
       
        assertEquals("TestIdentityParticipantStack", idp.getIdentityParticipantStack());
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-sp.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        SPType sp = (SPType) picketlink.getIdpOrSP();
        assertNotNull(sp);
        assertEquals("REDIRECT", sp.getBindingType());
        assertEquals("tomcat", sp.getServerEnvironment());
        assertEquals("someURL", sp.getRelayState());
        assertEquals("/someerror.jsp", sp.getErrorPage());
        assertEquals("/customLogoutPage.jsp", sp.getLogOutPage());
        assertTrue(sp.isSupportsSignature());
        assertTrue(picketlink.isEnableAudit());
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-consolidated-sts.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        STSType sts = picketlink.getStsType();
        assertNotNull(sts);
        assertTrue(picketlink.isEnableAudit());
    }
View Full Code Here

Examples of org.picketlink.identity.federation.core.config.PicketLinkType

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-handlers.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        Handlers handlers = picketlink.getHandlers();
        assertNotNull(handlers);
        assertNotNull(handlers.getHandlerChainClass());
        assertFalse(handlers.getHandler().isEmpty());
    }
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.