public static MetaStorePasswdAuthenticationProvider getAuthenticationProvider(Configuration conf, AuthMethods authMethod)
    throws AuthenticationException {
    if (authMethod == AuthMethods.LDAP) {
      return new MetaStoreLdapAuthenticationProviderImpl(conf);
    } else if (authMethod == AuthMethods.CUSTOM) {
      return new MetaStoreCustomAuthenticationProviderImpl(conf);
    } else if (authMethod == AuthMethods.CONFIG) {
      return new MetaStoreConfigAuthenticationProviderImpl(conf);
    } else if (authMethod == AuthMethods.NONE) {
      return new MetaStoreAnonymousAuthenticationProviderImpl();
    } else {
      throw new AuthenticationException("Unsupported authentication method");
    }
  }
This class helps select a {@link MetaStorePasswdAuthenticationProvider} for a given {@code
AuthMethod}.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreAuthenticationProviderFactory.java