It was narrated from Abu Sa’eed Al-Khudri that the Messenger of Allah (ﷺ) sent ‘Alqamah bin Mujazziz at the head of a detachment, and I was among them. When he reached the battle site, or when he was partway there, a group of the army asked permission to take a different route, and he gave them permission, and appointed ‘Abdullah bin Hudhafah bin Qais As-Sahmi as their leader, and I was one of those who fought alongside with him. When we were partway there, the people lit a fire to warm themselves and cook some food. ‘Abdullah, who was a man who liked to joke, said: “Do I not have the right that you should listen to me and obey?” They said: “Yes.” He said: “And if I command you to do something, will you not do it?” They said: “Of course.” He said: “Then I command you to jump into this fire.” Some people got up and got ready to jump, and when he saw that they were about to jump, he said: “Restrain yourselves, for I was joking with you.” When we came to Al-Madinah, they mentioned that to the Prophet (ﷺ), and the Messenger of Allah (ﷺ) said: “Whoever among you commands you to do something that involves disobedience to Allah, do not obey him.”
It was narrated from Ibn ‘Umar that the Messenger of Allah (ﷺ) said: “The Muslim is obliged to obey (the ruler) whether he likes it or not, unless he is commanded to commit an act of disobedience. If he is commanded to commit a sin then he should neither listen nor obey.”
It was narrated from ‘Abdullah bin Mas’ud that the Prophet (ﷺ) said: “Among those in charge of you, after I am gone, will be men who extinguish the Sunnah and follow innovation. They will delay the prayer from its proper time.” I said: “O Messenger of Allah, if I live to see them, what should I do?” He said: “You ask me, O Ibn ‘Abd, what you should do? There is no obedience to one who disobeys Allah.”