@Test public void shouldReturnTrueWhenRequestQueryParamsContainsActionLogout() { HttpServletRequest request = mock(HttpServletRequest.class); Map<String, String[]> parameterMap = new HashMap<String, String[]>(); given(request.getParameterMap()).willReturn(parameterMap); parameterMap.put("_action", new String[]{"logOUT"}); boolean authorized = sessionResourceAuthzFilter.authorize(request, null); assertTrue(authorized); }
@Override public boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { if (servletRequest != null) { Map<String, String[]> parameterMap = servletRequest.getParameterMap(); if (parameterMap != null && parameterMap.containsKey("_action")) { String[] values = parameterMap.get("_action"); if (values != null && values.length > 0 && "logout".equalsIgnoreCase(values[0])) { return true; } } } return super.authorize(servletRequest, servletResponse); }
SessionResourceAuthzFilter extends AdminAuthorizationFilter { @Override public boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { if (servletRequest != null) { Map<String, String[]> parameterMap = servletRequest.getParameterMap(); if (parameterMap != null && parameterMap.containsKey("_action")) { String[] values = parameterMap.get("_action"); if (values != null && values.length > 0 && "logout".equalsIgnoreCase(values[0])) { return true; } } } return super.authorize(servletRequest, servletResponse); } }
SessionResourceAuthzFilter extends AdminAuthorizationFilter { @Override public boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { if (servletRequest != null) { Map<String, String[]> parameterMap = servletRequest.getParameterMap(); if (parameterMap != null && parameterMap.containsKey("_action")) { String[] values = parameterMap.get("_action"); if (values != null && values.length > 0 && "logout".equalsIgnoreCase(values[0])) { return true; } } } return super.authorize(servletRequest, servletResponse); } @Inject  SessionResourceAuthzFilter(SSOTokenFactory ssoTokenFactory, AuthnRequestUtils requestUtils,
            SessionService sessionService, AuthUtilsWrapper authUtilsWrapper); }
SessionResourceAuthzFilter extends AdminAuthorizationFilter { @Override public boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { if (servletRequest != null) { Map<String, String[]> parameterMap = servletRequest.getParameterMap(); if (parameterMap != null && parameterMap.containsKey("_action")) { String[] values = parameterMap.get("_action"); if (values != null && values.length > 0 && "logout".equalsIgnoreCase(values[0])) { return true; } } } return super.authorize(servletRequest, servletResponse); } @Inject  SessionResourceAuthzFilter(SSOTokenFactory ssoTokenFactory, AuthnRequestUtils requestUtils,
            SessionService sessionService, AuthUtilsWrapper authUtilsWrapper); @Override boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse); }
SessionResourceAuthzFilter extends AdminAuthorizationFilter { @Override public boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { if (servletRequest != null) { Map<String, String[]> parameterMap = servletRequest.getParameterMap(); if (parameterMap != null && parameterMap.containsKey("_action")) { String[] values = parameterMap.get("_action"); if (values != null && values.length > 0 && "logout".equalsIgnoreCase(values[0])) { return true; } } } return super.authorize(servletRequest, servletResponse); } @Inject  SessionResourceAuthzFilter(SSOTokenFactory ssoTokenFactory, AuthnRequestUtils requestUtils,
            SessionService sessionService, AuthUtilsWrapper authUtilsWrapper); @Override boolean authorize(HttpServletRequest servletRequest, HttpServletResponse servletResponse);  }