geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
public static Object verifyCredentials(String authenticatorMethod, Properties credentials,
      Properties securityProperties, InternalLogWriter logWriter,
      InternalLogWriter securityLogWriter, DistributedMember member,
      SecurityService securityService)
      throws AuthenticationRequiredException, AuthenticationFailedException {

    if (!AcceptorImpl.isAuthenticationRequired()) {
      return null;
    }

    Authenticator auth = null;
    try {
      if (AcceptorImpl.isIntegratedSecurity()) {
        return securityService.login(credentials);
      } else {
        Method instanceGetter = ClassLoadUtil.methodFromName(authenticatorMethod);
        auth = (Authenticator) instanceGetter.invoke(null, (Object[]) null);
        auth.init(securityProperties, logWriter, securityLogWriter);
        return auth.authenticate(credentials, member);
      }
    } catch (AuthenticationFailedException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new AuthenticationFailedException(ex.getMessage(), ex);
    } finally {
      if (auth != null) {
        auth.close();
      }
    }
  }
/**
   * this could return either a Subject or a Principal depending on if it's integrated security or
   * not
   */
this could return either a Subject or a Principal depending on if it's integrated security or
not
this could return either a Subject or a Principal depending on if it ' s integrated security or not
public static Object verifyCredentials(String authenticatorMethod, Properties credentials,
      Properties securityProperties, InternalLogWriter logWriter,
      InternalLogWriter securityLogWriter, DistributedMember member,
      SecurityService securityService)
      throws AuthenticationRequiredException, AuthenticationFailedException {
    if (!AcceptorImpl.isAuthenticationRequired()) {
      return null;
    }
    Authenticator auth = null;
    try {
      if (AcceptorImpl.isIntegratedSecurity()) {
        return securityService.login(credentials);
      } else {
        Method instanceGetter = ClassLoadUtil.methodFromName(authenticatorMethod);
        auth = (Authenticator) instanceGetter.invoke(null, (Object[]) null);
        auth.init(securityProperties, logWriter, securityLogWriter);
        return auth.authenticate(credentials, member);
      }
    } catch (AuthenticationFailedException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new AuthenticationFailedException(ex.getMessage(), ex);
    } finally {
      if (auth != null) {
        auth.close();
      }
    }
  }
public static Object verifyCredentials ( String authenticatorMethod , Properties credentials , Properties securityProperties , InternalLogWriter logWriter , InternalLogWriter securityLogWriter , DistributedMember member , SecurityService securityService ) throws AuthenticationRequiredException , AuthenticationFailedException { if ( ! AcceptorImpl . isAuthenticationRequired ( ) ) { return null ; } Authenticator auth = null ; try { if ( AcceptorImpl . isIntegratedSecurity ( ) ) { return securityService . login ( credentials ) ; } else { Method instanceGetter = ClassLoadUtil . methodFromName ( authenticatorMethod ) ; auth = ( Authenticator ) instanceGetter . invoke ( null , ( Object [ ] ) null ) ; auth . init ( securityProperties , logWriter , securityLogWriter ) ; return auth . authenticate ( credentials , member ) ; } } catch ( AuthenticationFailedException ex ) { throw ex ; } catch ( Exception ex ) { throw new AuthenticationFailedException ( ex . getMessage ( ) , ex ) ; } finally { if ( auth != null ) { auth . close ( ) ; } } }
this could return either a Subject or a Principal depending on if it's integrated security or
 not
this could return either a Subject or a Principal depending on if it ' s integrated security or not