Examples of handleSecurity()


Examples of org.apache.sling.auth.core.AuthenticationSupport.handleSecurity()

            final String wsp = getWorkspace(request.getPathInfo());
            if (wsp != null) {
                request.setAttribute("j_workspace", wsp);
            }
            return localAuthenticator.handleSecurity(request, response);
        }
        // send 503/SERVICE UNAVAILABLE, flush to ensure delivery
        response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
        response.flushBuffer();
View Full Code Here

Examples of org.apache.sling.auth.core.AuthenticationSupport.handleSecurity()

            // SLING-559: ensure correct parameter handling according to
            // ParameterSupport
            request = ParameterSupport.getParameterSupportRequestWrapper(request);

            return authenticator.handleSecurity(request, response);

        }

        log.error("handleSecurity: AuthenticationSupport service missing. Cannot authenticate request.");
        log.error("handleSecurity: Possible reason is missing Repository service. Check AuthenticationSupport dependencies.");
View Full Code Here

Examples of org.apache.sling.auth.core.AuthenticationSupport.handleSecurity()

    public boolean handleSecurity(final HttpServletRequest request, final HttpServletResponse response)
            throws IOException {
        final AuthenticationSupport localAuthenticator = this.authenticator;
        if (localAuthenticator != null) {
            final boolean authResult = localAuthenticator.handleSecurity(request, response);
            if (authResult) {
                if (this.allowedUserIds.size() == 0) {
                    return true;
                } else {
                    final String userId = (String) request.getAttribute(HttpContext.REMOTE_USER);
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

                return;
            }

            // Perform a security check before dispatching the request.
            HttpContext httpContext = registration.getHttpContext();
            if (!httpContext.handleSecurity(request, response)) {
                return;
            }

            // It is possible that in the time between getting the registration
            // and invoking it that the bundle that registered it has been
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

                HttpServletResponse resp = (HttpServletResponse) invocation.getArguments()[1];
                resp.setStatus(HttpServletResponse.SC_OK);
                return null;
            }
        }).when(servlet).service(request, response);
        when(context.handleSecurity(request, response)).thenReturn(true);
        when(request.getPathInfo()).thenReturn("/a/b/c");

        dispatcher.register(registration);
        dispatcher.service(request, response);
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

        ServletDispatcher dispatcher = new ServletDispatcher();
        Servlet servlet = mock(Servlet.class);
        HttpContext context = mock(HttpContext.class);
        ServletRegistration registration = new ServletRegistration("/a/b", servlet, context);

        when(context.handleSecurity(request, response)).thenAnswer(new Answer()
        {
            public Boolean answer(InvocationOnMock invocation)
            {
                HttpServletResponse resp = (HttpServletResponse) invocation.getArguments()[1];
                resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

                HttpServletResponse resp = (HttpServletResponse) invocation.getArguments()[1];
                resp.setStatus(HttpServletResponse.SC_OK);
                return null;
            }
        }).when(servlet).service(request, response);
        when(context.handleSecurity(request, response)).thenReturn(true);
        when(request.getPathInfo()).thenReturn("/a/b/c");

        dispatcher.register(registration);
        dispatcher.service(request, response);
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

        Servlet servlet = mock(Servlet.class);
        HttpContext context = mock(HttpContext.class);
        ServletRegistration registration = new ServletRegistration("/a/b", servlet, context);

        doThrow(new NullPointerException()).when(servlet).service(request, response);
        when(context.handleSecurity(request, response)).thenReturn(true);
        when(request.getPathInfo()).thenReturn("/a/b/c");

        dispatcher.register(registration);
        dispatcher.service(request, response);
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

        Servlet servlet = mock(Servlet.class);
        HttpContext context = mock(HttpContext.class);
        ServletRegistration registration = new ServletRegistration("/a/b", servlet, context);

        doThrow(new ServletException()).when(servlet).service(request, response);
        when(context.handleSecurity(request, response)).thenReturn(true);
        when(request.getPathInfo()).thenReturn("/a/b/c");

        dispatcher.register(registration);
        try
        {
View Full Code Here

Examples of org.osgi.service.http.HttpContext.handleSecurity()

                HttpServletResponse resp = (HttpServletResponse) invocation.getArguments()[1];
                resp.setStatus(HttpServletResponse.SC_OK);
                return null;
            }
        }).when(servlet).service(request, response);
        when(context.handleSecurity(request, response)).thenReturn(true);
        when(request.getPathInfo()).thenReturn("/a/b/c");

        dispatcher.register(registration);
        dispatcher.service(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.