Package org.picketlink.identity.federation.core.wstrust

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustRequestHandler


        STSConfiguration config = new PicketLinkSTSConfiguration(stsType);
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        InputStream is = getClass().getClassLoader().getResourceAsStream("wstrust/wstrust-rst-usekey.xml");
        assertNotNull(is);

        WSTrustParser parser = new WSTrustParser();
        RequestSecurityToken token = (RequestSecurityToken) parser.parse(is);

        RequestSecurityTokenResponse response = handler.issue(token, new Principal() {
            @Override
            public String getName() {
                return "testuser";
            }
        });
View Full Code Here


        // check the values that have been configured.
        assertEquals("Unexpected service name", "Test STS", config.getSTSName());
        assertEquals("Unexpected token timeout value", 7200 * 1000, config.getIssuedTokenTimeout());
        assertFalse("Encrypt token should be true", config.encryptIssuedToken());
        WSTrustRequestHandler handler = config.getRequestHandler();
        assertNotNull("Unexpected null request handler found", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // check the token type -> token provider mapping.
        SecurityTokenProvider provider = config.getProviderForTokenType("http://www.tokens.org/SpecialToken");
View Full Code Here

    public void testCreateRequestHandler() throws Exception {
        STSConfiguration config = new PicketLinkSTSConfiguration();
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // try to create an invalid instance of request handler.
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.wstrust.WSTrustRequestHandler

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.