Wa'il bin Hujr (May Allah be pleased with him) reported:
Salamah bin Yazid Al-Ju'f (May Allah be pleased with him) asked Messenger of Allah (ﷺ): "O Prophet of Allah! Tell us, what you command us to do if there arises over us rulers who demand of us what is due to them and refuse us what is due to us." Messenger of Allah (ﷺ) turned away from him, but he repeated the same question. Thereupon Messenger of Allah (ﷺ) said, "Listen to them and obey them. They are responsible for their obligations and you are accountable for yours."[Muslim].
Arabic/English book reference: Book 1, Hadith 669