Examples of commence()


Examples of org.springframework.security.cas.web.CasAuthenticationEntryPoint.commence()

        request.setRequestURI("/some_path");

        MockHttpServletResponse response = new MockHttpServletResponse();

        ep.afterPropertiesSet();
        ep.commence(request, response, null);

        assertEquals("https://cas/login?service="
            + URLEncoder.encode("https://mycompany.com/bigWebApp/j_spring_cas_security_check", "UTF-8"),
            response.getRedirectedUrl());
    }
View Full Code Here

Examples of org.springframework.security.cas.web.CasAuthenticationEntryPoint.commence()

        request.setRequestURI("/some_path");

        MockHttpServletResponse response = new MockHttpServletResponse();

        ep.afterPropertiesSet();
        ep.commence(request, response, null);
        assertEquals("https://cas/login?service="
            + URLEncoder.encode("https://mycompany.com/bigWebApp/j_spring_cas_security_check", "UTF-8") + "&renew=true",
            response.getRedirectedUrl());
    }
}
View Full Code Here

Examples of org.springframework.security.cas.web.CasAuthenticationEntryPoint.commence()

        try {
            aep.afterPropertiesSet();
        } catch (Exception e) {
            throw new IOException(e);
        }       
        aep.commence(request, response, authException);           
    }
   
    public void sendUnauthorized(ServletResponse response) throws IOException {
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
View Full Code Here

Examples of org.springframework.security.ui.AuthenticationEntryPoint.commence()

       
        String url = getUrl(request);

        AuthenticationEntryPoint entryPoint = getAppropriateEntryPoint(url);
       
        entryPoint.commence(request, response, authException);
       
    }
   
    private AuthenticationEntryPoint getAppropriateEntryPoint(String url) {
        for (String pattern : m_patterns) {
View Full Code Here

Examples of org.springframework.security.web.AuthenticationEntryPoint.commence()

            if (requestMatcher.matches(request)) {
               AuthenticationEntryPoint entryPoint = entryPoints.get(requestMatcher);
               if(logger.isDebugEnabled()) {
                   logger.debug("Match found! Executing " + entryPoint);
               }
               entryPoint.commence(request, response, authException);
               return;
            }
        }

        if(logger.isDebugEnabled()) {
View Full Code Here

Examples of org.springframework.security.web.AuthenticationEntryPoint.commence()

                return super.authenticate(response);
            }
            if(isAuthenticated()) {
                return true;
            }
            entryPoint.commence(this, response, new AuthenticationCredentialsNotFoundException("User is not Authenticated"));
            return false;
        }

        public void login(String username, String password) throws ServletException {
            if(isAuthenticated()) {
View Full Code Here

Examples of org.springframework.security.web.AuthenticationEntryPoint.commence()

                return;
            }
           
            // entry point from request ?
            if (aep!=null) {
                aep.commence(request, response, authException);
                return;
            }

            // 403, FORBIDDEN
            defaultEntryPoint.commence(request, response, authException);   
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpEntryPoint.commence()

        RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(80, 443));

        ep.commence(request, response);
        assertEquals("http://www.example.com/bigWebApp/hello/pathInfo.html?open=true", response.getRedirectedUrl());
    }

    public void testNormalOperationWithNullQueryString() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp/hello");
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpEntryPoint.commence()

        RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(80, 443));

        ep.commence(request, response);
        assertEquals("http://www.example.com/bigWebApp/hello", response.getRedirectedUrl());
    }

    public void testOperationWhenTargetPortIsUnknown() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp");
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpEntryPoint.commence()

        RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(8768, 1234));

        ep.commence(request, response);
        assertEquals("/bigWebApp?open=true", response.getRedirectedUrl());
    }

    public void testOperationWithNonStandardPort() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp/hello/pathInfo.html");
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.