Imran bin Husayn reported,

He said to Hakam bin Amr al-Ghifari, "Did you hear the Messenger of Allah ﷺ say, 'There is no obedience owed to anyone in disobedience to Allah'?"He replied, "Yes."Imran said, "Praise be to Allah," or, "Allah is the Greatest."

Azami 7627

Sahih

عن عمران بن حصين

أنه قال للحكم بن عمرو الغفاري: أسمعت رسول الله ﷺ يقول: لا طاعة لأحد في معصية الله تبارك وتعالى قال: نعم فقال عمران: الله الحمد أو الله أكبر.

الأعظمي 7627صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Leadership
Section
Obligation of obeying those in authority in matters that are not disobedience to Allah
Numbering
Jami al-Kamil 7627 (2nd edition)
Azami 7627