Abdullah bin Umar reported,

The Prophet ﷺ said, "Listening and obeying are an obligation upon the Muslim in what he likes and what he dislikes, as long as he is not commanded to commit a sin. But if he is commanded to commit a sin, then there is no listening and no obeying."

Azami 7619

Sahih

عن ابن عمر

عن النبي ﷺ قال: السمع والطاعة على المرء المسلم فيما أحب وكره ما لم يؤمر بمعصية، فإذا أمر بمعصية فلا سمع ولا طاعة.

الأعظمي 7619صحيح
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 7619 (2nd edition)
Azami 7619