Confucianism was the official philosophy throughout most of Imperial China's history, and mastery of Confucian texts was the primary criterion for entry into the imperial bureaucracy. A number of more authoritarian strains of thought have also been influential, such as Legalism.