docs: @Override
      public Subject authenticate(String jaasEntryName, CallbackHandler callbackHandler, Subject subject) throws AuthenticationException {
          CallbackHandlerAuthenticationData cAuthData = new CallbackHandlerAuthenticationData(callbackHandler);
          AuthenticationData authenticationData = null;
          try {
              authenticationData = cAuthData.createAuthenticationData();
          } catch (Exception e) {
              throw new AuthenticationException(e.getMessage());
          }
  
          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, callbackHandler, subject);
                      insertSubjectInAuthCache(authenticationData, authenticatedSubject);
                  }
                  return authenticatedSubject;
              }
          } finally {
              releaseLock(authenticationData, currentLock);
          }
      }