code: @Override
      public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
          // we trust this header value because only MDW can set it
          String authUser = (String)headers.get(Listener.AUTHENTICATED_USER_HEADER);
          try {
              if (authUser == null)
                  throw new ServiceException("Missing parameter: " + Listener.AUTHENTICATED_USER_HEADER);
              UserServices userServices = ServiceLocator.getUserServices();
              User userVO = userServices.getUser(authUser);
              if (userVO == null)
                  throw new ServiceException(HTTP_404_NOT_FOUND, "User not found: " + authUser);
              return userVO.getJsonWithRoles();
          }
          catch (DataAccessException ex) {
                  throw new ServiceException(ex.getCode(), ex.getMessage(), ex);
          }
          catch (Exception ex) {
              throw new ServiceException("Error getting authenticated user: " + authUser, ex);
          }
      }
docs: Retrieve the current authenticated user.