private static String createDefaultMessage(String username, UserAuthenticationType authenticationType) {
    return String.format("%s is not authorized to authenticate using %s",
        username,
        (authenticationType == null) ? "null" : authenticationType.name());
  }
AuthenticationMethodNotAllowedException is an AuthenticationException implementation to be thrown
when the specified authentication method is not allowed for the relevant user.
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/AuthenticationMethodNotAllowedException.java