docs: public Principal getCallerPrincipal(boolean useRealm, String realm, boolean web, boolean isJaspiEnabled) {
          Subject subject = subjectManager.getCallerSubject();
          if (subject == null) {
              return null;
          }
  
          SubjectHelper subjectHelper = new SubjectHelper();
          if (subjectHelper.isUnauthenticated(subject) && web) {
              return null;
          }
  
          if (isJaspiEnabled) {
              Principal principal = getPrincipalFromWSCredential(subjectHelper, subject);
              if (principal != null) {
                  return principal;
              }
          }
  
          String securityName = getSecurityNameFromWSCredential(subjectHelper, subject);
          if (securityName == null) {
              return null;
          }
  
          Principal jsonWebToken = MpJwtHelper.getJsonWebTokenPricipal(subject);
          if (jsonWebToken != null) {
              return jsonWebToken;
          }
  
          Set<WSPrincipal> principals = subject.getPrincipals(WSPrincipal.class);
          if (principals.size() > 1) {
              multiplePrincipalsError(principals);
          }
  
          WSPrincipal wsPrincipal = null;
          if (!principals.isEmpty()) {
              String principalName = createPrincipalName(useRealm, realm, securityName);
              wsPrincipal = principals.iterator().next();
              wsPrincipal = new WSPrincipal(principalName, wsPrincipal.getAccessId(), wsPrincipal.getAuthenticationMethod());
          }
          return wsPrincipal;
      }