Package org.picketlink.identity.federation.bindings.tomcat.sp

Examples of org.picketlink.identity.federation.bindings.tomcat.sp.SPRedirectFormAuthenticator.authenticate()


        MockCatalinaSession session = new MockCatalinaSession();

        sp.setContainer(context);
        sp.testStart();

        sp.authenticate(request, response, loginConfig);

        String redirectStr = response.redirectString;
        assertNotNull("Redirect String is null?", redirectStr);
        String saml = redirectStr.substring(redirectStr.indexOf(SAML_REQUEST_KEY) + SAML_REQUEST_KEY.length());
View Full Code Here


        sp.setContainer(context);
        sp.testStart();
        sp.getConfiguration().setIdpUsesPostBinding(false);

        assertTrue("Employee app auth success", sp.authenticate(request, response, loginConfig));
    }

    private MockCatalinaContextClassLoader setupTCL(String resource) {
        URL[] urls = new URL[] { tcl.getResource(resource) };
View Full Code Here

        MockCatalinaResponse catalinaResponse = new MockCatalinaResponse();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        catalinaResponse.setWriter(new PrintWriter(baos));

        LoginConfig loginConfig = new LoginConfig();
        assertTrue(spEmpl.authenticate(catalinaRequest, catalinaResponse, loginConfig));

        Map<String, List<Object>> sessionMap = (Map<String, List<Object>>) session
                .getAttribute(GeneralConstants.SESSION_ATTRIBUTE_MAP);
        assertNotNull(sessionMap);
        assertEquals("sales", sessionMap.get("Role").get(0));
View Full Code Here

        MockCatalinaLoginConfig loginConfig = new MockCatalinaLoginConfig();

        ByteArrayOutputStream filterbaos = new ByteArrayOutputStream();
        response.setWriter(new PrintWriter(filterbaos));
        catalinaRequest.setParameter(GeneralConstants.GLOBAL_LOGOUT, "true");
        sp.authenticate(catalinaRequest, response, loginConfig);

        String redirectStr = response.redirectString;
        String logoutRequest = redirectStr.substring(redirectStr.indexOf(SAML_REQUEST_KEY) + SAML_REQUEST_KEY.length());

        InputStream stream = RedirectBindingUtil.urlBase64DeflateDecode(logoutRequest);
View Full Code Here

        MockCatalinaResponse filterResponse = new MockCatalinaResponse();
        ByteArrayOutputStream filterbaos = new ByteArrayOutputStream();
        filterResponse.setWriter(new PrintWriter(filterbaos));

        sp.authenticate(request, response, new LoginConfig());

        redirectStr = response.redirectString;

        destination = redirectStr.substring(0, redirectStr.indexOf(SAML_RESPONSE_KEY) - 1);
        relayState = redirectStr.substring(redirectStr.indexOf(RELAY_STATE_KEY) + RELAY_STATE_KEY.length());
View Full Code Here

        request.setParameter("SAMLResponse", RedirectBindingUtil.urlDecode(logoutResponse));
        request.setParameter("RelayState", relayState);
        request.setContext(context);

        //IDP should now send the final logout response to Sales application who sent the original request
        sp.authenticate(request, response, new LoginConfig());

        //Ensure that at the IDP we do not have any participants in the session (both employee and sales are logged out)
        IdentityParticipantStack stack = server.stack();
        assertEquals(0, stack.getParticipants(session.getId()));
        assertEquals(0, stack.getNumOfParticipantsInTransit(session.getId()));
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.