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);
 }