public static AuthMethods getValidAuthMethod(String authMethodStr)
      throws AuthenticationException {
      for (AuthMethods auth : AuthMethods.values()) {
        if (authMethodStr.equals(auth.getAuthMethod())) {
          return auth;
        }
      }
      throw new AuthenticationException("Not a valid 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