@Test @Deploy("org.nuxeo.ecm.platform.web.common.test:OSGI-INF/test-authchain-dummy-anonymous.xml") public void testAuthForceAnonymousLogin() throws Exception { HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); HttpSession session = mock(HttpSession.class); Map<String, Object> sessionAttributes = mockSessionAttributes(session); when(request.getSession(anyBoolean())).thenReturn(session); mockRequestURI(request, "/mystart/foo", "", FORCE_ANONYMOUS_LOGIN + "=true"); when(request.getParameter(eq(FORCE_ANONYMOUS_LOGIN))).thenReturn("true"); ByteArrayOutputStream out = new ByteArrayOutputStream(); @SuppressWarnings("resource") PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, UTF_8), true); when(response.getWriter()).thenReturn(writer); filter.doFilter(request, response, chain); assertFalse(chain.called); checkNoCachedUser(sessionAttributes); checkNoEvents(); verify(response).setContentType(eq("text/html;charset=UTF-8")); writer.flush(); String entity = out.toString(UTF_8); assertTrue(entity, entity.contains( "window.location = 'http: }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try (Timer.Context contextTimer = requestTimer.time()) { concurrentCount.inc(); if (concurrentCount.getCount() > concurrentMaxCount.getCount()) { concurrentMaxCount.inc(); } try { doInitIfNeeded(); doFilterInternal(request, response, chain); } finally { LoginComponent.clearPrincipalStack(); concurrentCount.dec(); } } }
NuxeoAuthenticationFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try (Timer.Context contextTimer = requestTimer.time()) { concurrentCount.inc(); if (concurrentCount.getCount() > concurrentMaxCount.getCount()) { concurrentMaxCount.inc(); } try { doInitIfNeeded(); doFilterInternal(request, response, chain); } finally { LoginComponent.clearPrincipalStack(); concurrentCount.dec(); } } } }
NuxeoAuthenticationFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try (Timer.Context contextTimer = requestTimer.time()) { concurrentCount.inc(); if (concurrentCount.getCount() > concurrentMaxCount.getCount()) { concurrentMaxCount.inc(); } try { doInitIfNeeded(); doFilterInternal(request, response, chain); } finally { LoginComponent.clearPrincipalStack(); concurrentCount.dec(); } } }  }
NuxeoAuthenticationFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try (Timer.Context contextTimer = requestTimer.time()) { concurrentCount.inc(); if (concurrentCount.getCount() > concurrentMaxCount.getCount()) { concurrentMaxCount.inc(); } try { doInitIfNeeded(); doFilterInternal(request, response, chain); } finally { LoginComponent.clearPrincipalStack(); concurrentCount.dec(); } } }  @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain); NuxeoAuthenticationPlugin getAuthenticator(CachableUserIdentificationInfo ci); @Override void init(FilterConfig config); boolean saveRequestedURLBeforeRedirect(HttpServletRequest httpRequest, HttpServletResponse httpResponse); static String getRequestedUrl(HttpServletRequest request); static String getRequestedPage(ServletRequest request); static NuxeoLoginContext loginAs(String username); }
NuxeoAuthenticationFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try (Timer.Context contextTimer = requestTimer.time()) { concurrentCount.inc(); if (concurrentCount.getCount() > concurrentMaxCount.getCount()) { concurrentMaxCount.inc(); } try { doInitIfNeeded(); doFilterInternal(request, response, chain); } finally { LoginComponent.clearPrincipalStack(); concurrentCount.dec(); } } }  @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); void doFilterInternal(ServletRequest request, ServletResponse response, FilterChain chain); NuxeoAuthenticationPlugin getAuthenticator(CachableUserIdentificationInfo ci); @Override void init(FilterConfig config); boolean saveRequestedURLBeforeRedirect(HttpServletRequest httpRequest, HttpServletResponse httpResponse); static String getRequestedUrl(HttpServletRequest request); static String getRequestedPage(ServletRequest request); static NuxeoLoginContext loginAs(String username); @Deprecated
    static final String DEFAULT_START_PAGE; static final String LOGIN_DOMAIN; }