docs: @Override
      public Subject authenticate(String jaasEntryName, AuthenticationData authenticationData, Subject subject) throws AuthenticationException {
          ReentrantLock currentLock = optionallyObtainLockedLock(authenticationData);
          try {
              // If basic auth login to a different realm, then create a basic auth subject
              if (isBasicAuthLogin(authenticationData)) {
                  return createBasicAuthSubject(authenticationData, subject);
              } else {
                  Subject authenticatedSubject = findSubjectInAuthCache(authenticationData, subject);
                  if (authenticatedSubject == null) {
                      authenticatedSubject = performJAASLogin(jaasEntryName, authenticationData, subject);
                      insertSubjectInAuthCache(authenticationData, authenticatedSubject);
                  }
                  return authenticatedSubject;
              }
          } finally {
              releaseLock(authenticationData, currentLock);
          }
      }