public static AuthMethods getValidAuthMethod(String authMethodStr)
      throws AuthenticationException {
      for (AuthMethods auth : AuthMethods.values()) {
        if (authMethodStr.toLowerCase().contains(auth.getAuthMethod().toLowerCase())) {
          return auth;
        }
      }
      throw new AuthenticationException("Not a valid authentication method");
    }
This class helps select a {@link PasswdAuthenticationProvider} for a given {@code AuthMethod}.
service/src/java/org/apache/hive/service/auth/AuthenticationProviderFactory.java