Package org.pac4j.core.context

Examples of org.pac4j.core.context.WebContext


    @Test
    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


    }

    @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

        if (session != null) {
            next.handle(null);
        } else {
            session = request.createSession();

            WebContext webContext = new VertxWebContext(request);
            // requested url to save
            final String requestedUrlToSave = webContext.getFullRequestURL();

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

            try {
View Full Code Here

TOP

Related Classes of org.pac4j.core.context.WebContext

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.