Benjamin Franklin famously suggested using the following motto to be used for the Seal of the United States of America. "Disobedience to tyrants is obedience to God". ~ Benjamin Franklin
When the governing authority ceases to do good, they cease to be an authority. He didn't make this up. He got this from the early church fathers, for example, St. Thomas Aquinas.
"Human law is law only by virtue of its accordance with right reason; and thus it is manifest that it flows from the eternal law. And in so far as it deviates from right reason it is called an unjust law; in such case it is no law at all, but rather a species of violence." ~ Thomas Aquinas
Or to put it simply, "Unjust law is no law at all"