public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
      throws Exception {
    RequestData requestData =
        RequestUtil.createRequestData(request, SystemConfiguration.getSimbaWebURL());

    try {
      ActionDescriptor actionDescriptor =
          authenticationService.processRequest(
              requestData, SystemConfiguration.getManagerAuthorizationChainName());
      if (actionDescriptor.getActionTypes().contains(ActionType.DO_FILTER_AND_SET_PRINCIPAL)) {
        return true;
      }
    } catch (Exception ignored) {
    }
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    return false;
  }
예제 #2
0
 private SSOToken getSSOToken() {
   return RequestUtil.getSsoTokenThatShouldBePresent(request);
 }