According to the American colonists, a government is only legitimate if it has

direct or pure democracy
consent of the governed
declared independence
contracts with citizens