docs: @Override
      public IPerson getPerson(HttpServletRequest request) throws PortalSecurityException {
  
          /*
           * This method overrides the implementation of getPerson() in BasePersonManager, but we only
           * want the RemoteUser behavior here if we're using RemoteUser AuthN.
           */
          if (!remoteUserSecurityContextFactory.isEnabled()) {
              return super.getPerson(request);
          }
  
          // Return the person object if it exists in the user's session
          final HttpSession session = request.getSession(false);
          IPerson person = null;
          if (session != null) {
              person = (IPerson) session.getAttribute(PERSON_SESSION_KEY);
              if (person != null) {
                  return person;
              }
          }
  
          try {
              // Create a new instance of a person
              person = createPersonForRequest(request);
  
              // If the user has authenticated with the server which has implemented web
              // authentication,
              // the REMOTE_USER environment variable will be set.
              String remoteUser = request.getRemoteUser();
  
              // We don't want to ignore the security contexts which are already configured in
              // security.properties, so we
              // retrieve the existing security contexts.  If one of the existing security contexts is
              // a RemoteUserSecurityContext,
              // we set the REMOTE_USER field of the existing RemoteUserSecurityContext context.
              //
              // If a RemoteUserSecurityContext does not already exist, we create one and populate the
              // REMOTE_USER field.
  
              ISecurityContext context;
              Enumeration subContexts = null;
              boolean remoteUserSecurityContextExists = false;
  
              // Retrieve existing security contexts.
              context = person.getSecurityContext();
              if (context != null) subContexts = context.getSubContexts();
  
              if (subContexts != null) {
                  while (subContexts.hasMoreElements()) {
                      ISecurityContext ctx = (ISecurityContext) subContexts.nextElement();
                      // Check to see if a RemoteUserSecurityContext already exists, and set the
                      // REMOTE_USER
                      if (ctx instanceof RemoteUserSecurityContext) {
                          RemoteUserSecurityContext remoteuserctx = (RemoteUserSecurityContext) ctx;
                          remoteuserctx.setRemoteUser(remoteUser);
                          remoteUserSecurityContextExists = true;
                      }
                  }
              }
  
              // If a RemoteUserSecurityContext doesn't already exist, create one.
              // This preserves the default behavior of this class.
              if (!remoteUserSecurityContextExists) {
                  RemoteUserSecurityContext remoteuserctx = new RemoteUserSecurityContext(remoteUser);
                  person.setSecurityContext(remoteuserctx);
              }
          } catch (Exception e) {
              // Log the exception
              logger.error("Exception creating person for request: {}", request, e);
          }
          if (session != null) {
              // Add this person object to the user's session
              session.setAttribute(PERSON_SESSION_KEY, person);
          }
          // Return the new person object
          return (person);
      }