Examples of handleStatusResponseType()


Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AttributeHandler.handleStatusResponseType()

        myattr.put("testKey", "hello");
        AttributeStatementType attState = StatementUtil.createAttributeStatement(myattr);
        assertion.addStatement(attState);

        request.addOption(GeneralConstants.ASSERTION, assertion);
        handler.handleStatusResponseType(request, response);

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

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler.handleStatusResponseType()

        // Assert that ID from session is not null
        String inResponseIdFromSession = (String) servletRequest.getSession().getAttribute(GeneralConstants.AUTH_REQUEST_ID);
        assertNotNull(inResponseIdFromSession);

        // Handle response from IDP
        authenticationHandler.handleStatusResponseType(handlerContext.request, handlerContext.response);
        verificationHandler.handleStatusResponseType(handlerContext.request, handlerContext.response);

        // Verify that Id is not in session anymore. Becaue it was removed by SAML2ResponseIdVerificationHandler
        assertNull(servletRequest.getSession().getAttribute(GeneralConstants.AUTH_REQUEST_ID));
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler.handleStatusResponseType()

        // Set Id to session again as it was removed in previous processing
        servletRequest.getSession().setAttribute(GeneralConstants.AUTH_REQUEST_ID, inResponseIdFromSession);

        // Handle response with changed Id. This time it should fail
        try {
            authenticationHandler.handleStatusResponseType(handlerContextChangedId.request, handlerContextChangedId.response);
            verificationHandler.handleStatusResponseType(handlerContextChangedId.request, handlerContextChangedId.response);

            fail("Verification of InResponseTo should fail.");
        } catch (ProcessingException pe) {
            assertEquals(ErrorCodes.AUTHN_REQUEST_ID_VERIFICATION_FAILED, pe.getMessage());
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler.handleStatusResponseType()

        // Set Id to session again as it was removed in previous processing
        servletRequest.getSession().setAttribute(GeneralConstants.AUTH_REQUEST_ID, inResponseIdFromSession);

        // Now handle again response from IDP. This time it should also fail as InResponseTo is null
        try {
            authenticationHandler.handleStatusResponseType(handlerContextRemovedId.request, handlerContextRemovedId.response);
            verificationHandler.handleStatusResponseType(handlerContextRemovedId.request, handlerContextRemovedId.response);

            fail("Verification of InResponseTo should fail.");
        } catch (ProcessingException pe) {
            assertEquals(ErrorCodes.AUTHN_REQUEST_ID_VERIFICATION_FAILED, pe.getMessage());
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler.handleStatusResponseType()

            public String getName() {
                return "Hi";
            }
        });

        handler.handleStatusResponseType(request, response);
    }

    @Test
    public void testRoleAttributeMultipleValues() throws Exception {
        SAML2AuthenticationHandler handler = new SAML2AuthenticationHandler();
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler.handleStatusResponseType()

            public String getName() {
                return "Hi";
            }
        });

        handler.handleStatusResponseType(request, response);
       
        assertNotNull(session.getAttribute("org.picketlink.sp.SAML_ASSERTION"));
    }

    public void handleRequestedAuthnContextCustomization() throws Exception {
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2InResponseToVerificationHandler.handleStatusResponseType()

        String inResponseIdFromSession = (String) servletRequest.getSession().getAttribute(GeneralConstants.AUTH_REQUEST_ID);
        assertNotNull(inResponseIdFromSession);

        // Handle response from IDP
        authenticationHandler.handleStatusResponseType(handlerContext.request, handlerContext.response);
        verificationHandler.handleStatusResponseType(handlerContext.request, handlerContext.response);

        // Verify that Id is not in session anymore. Becaue it was removed by SAML2ResponseIdVerificationHandler
        assertNull(servletRequest.getSession().getAttribute(GeneralConstants.AUTH_REQUEST_ID));

        // 5) CHANGE InResponseId IN SAML RESPONSE. VALIDATION MUST FAIL NOW.
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2InResponseToVerificationHandler.handleStatusResponseType()

        servletRequest.getSession().setAttribute(GeneralConstants.AUTH_REQUEST_ID, inResponseIdFromSession);

        // Handle response with changed Id. This time it should fail
        try {
            authenticationHandler.handleStatusResponseType(handlerContextChangedId.request, handlerContextChangedId.response);
            verificationHandler.handleStatusResponseType(handlerContextChangedId.request, handlerContextChangedId.response);

            fail("Verification of InResponseTo should fail.");
        } catch (ProcessingException pe) {
            assertEquals(ErrorCodes.AUTHN_REQUEST_ID_VERIFICATION_FAILED, pe.getMessage());
        }
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2InResponseToVerificationHandler.handleStatusResponseType()

        servletRequest.getSession().setAttribute(GeneralConstants.AUTH_REQUEST_ID, inResponseIdFromSession);

        // Now handle again response from IDP. This time it should also fail as InResponseTo is null
        try {
            authenticationHandler.handleStatusResponseType(handlerContextRemovedId.request, handlerContextRemovedId.response);
            verificationHandler.handleStatusResponseType(handlerContextRemovedId.request, handlerContextRemovedId.response);

            fail("Verification of InResponseTo should fail.");
        } catch (ProcessingException pe) {
            assertEquals(ErrorCodes.AUTHN_REQUEST_ID_VERIFICATION_FAILED, pe.getMessage());
        }
View Full Code Here

Examples of org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler.handleStatusResponseType()

        SAML2SignatureValidationHandler validHandler = new SAML2SignatureValidationHandler();
        validHandler.initChainConfig(chainConfig);
        validHandler.initHandlerConfig(handlerConfig);

        validHandler.handleStatusResponseType(request, response);
    }
}
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.