Examples of RedirectAction


Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testSetComparisonTypeWithPostBinding() throws Exception {
        Saml2Client client = (Saml2Client) getClient();
        client.setComparisonType(AuthnContextComparisonTypeEnumeration.EXACT.toString());
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getDecodedAuthnRequest(action.getContent()).contains("Comparison=\"exact\""));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testRelayState() throws RequiresHttpAction {
        Saml2Client client = (Saml2Client) getClient();
        WebContext context = MockWebContext.create();
        context.setSessionAttribute(Saml2Client.SAML_RELAY_STATE_ATTRIBUTE, "relayState");
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(action.getContent().contains("<input type=\"hidden\" name=\"RelayState\" value=\"relayState\"/>"));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testCustomSpEntityIdForRedirectBinding() throws Exception {
        Saml2Client client = getClient();
        client.setSpEntityId("http://localhost:8080/callback");
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getInflatedAuthnRequest(action.getLocation())
                .contains(
                        "<saml2:Issuer xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\">http://localhost:8080/callback</saml2:Issuer>"));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testForceAuthIsSetForRedirectBinding() throws Exception {
        Saml2Client client = getClient();
        client.setForceAuth(true);
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getInflatedAuthnRequest(action.getLocation()).contains("ForceAuthn=\"true\""));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testSetComparisonTypeWithRedirectBinding() throws Exception {
        Saml2Client client = getClient();
        client.setComparisonType(AuthnContextComparisonTypeEnumeration.EXACT.toString());
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getInflatedAuthnRequest(action.getLocation()).contains("Comparison=\"exact\""));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testNameIdPolicyFormat() throws Exception{
        Saml2Client client = getClient();
        client.setNameIdPolicyFormat("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getInflatedAuthnRequest(action.getLocation()).contains("<saml2p:NameIDPolicy AllowCreate=\"true\" Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress\"/></saml2p:AuthnRequest>"));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    public void testAuthnContextClassRef() throws Exception {
        Saml2Client client = getClient();
        client.setComparisonType(AuthnContextComparisonTypeEnumeration.EXACT.toString());
        client.setAuthnContextClassRef("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport");
        WebContext context = MockWebContext.create();
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(getInflatedAuthnRequest(action.getLocation()).contains("<saml2p:RequestedAuthnContext Comparison=\"exact\"><saml2:AuthnContextClassRef xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>"));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

    @Test
    public void testRelayState() throws Exception {
        Saml2Client client = getClient();
        WebContext context = MockWebContext.create();
        context.setSessionAttribute(Saml2Client.SAML_RELAY_STATE_ATTRIBUTE, "relayState");
        RedirectAction action = client.getRedirectAction(context, true, false);
        assertTrue(action.getLocation().contains("RelayState=relayState"));
    }
View Full Code Here

Examples of org.pac4j.core.client.RedirectAction

            // this gets saved in the end of the request
            session.putString("pac4jRequestedUrl", requestedUrlToSave);

            try {
                RedirectAction action = client.getRedirectAction(webContext, true, isAjax);
                switch (action.getType()) {
                    case REDIRECT:
                        request.response().redirect(HttpConstants.TEMP_REDIRECT, action.getLocation());
                        break;
                    case SUCCESS:
                        request.response().setContentType("text/html", "utf-8");
                        request.response().end(action.getContent());
                        break;
                    default:
                        next.handle("Invalid redirect action type");
                }
            } catch (final RequiresHttpAction e) {
View Full Code Here

Examples of org.springmodules.xt.ajax.action.RedirectAction

    private static final Logger logger = Logger.getLogger(AjaxRedirectSender.class);
   
    public static void sendRedirect(HttpServletResponse httpResponse, String redirectUrl, Map model) throws IOException {
        logger.debug(new StringBuilder("Sending ajax redirect: ").append(redirectUrl));
        AjaxResponse ajaxResponse = new AjaxResponseImpl();
        ajaxResponse.addAction(new RedirectAction(redirectUrl, (Map) null));
        AjaxResponseSender.sendResponse(httpResponse, ajaxResponse);
    }
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.