In my view, legitimate authority is legally elected/appointed by the will of the people. Government should only function by the consent of the governed, and the government should work for the people, not the other way around.
Ultimately, in the US or any Constitutional Democratic Republic, legitimate governmental authority proceeds from the powers given the various branches of government by the Constitution, and laws enacted by the majority vote of our duly elected representatives acting within those constitutional limits of power—or enforced after enactment by the Executive branch and interpreted by the Judicial Branch.