Umm Salama bint Abu Umaya reported,

The wife of the Prophet ﷺ reported that the Prophet ﷺ said, "Rulers will be appointed over you whose actions you will recognize as right and others as wrong. Whoever hates such wrongdoing is absolved, and whoever rejects it is safe, but not the one who is pleased and follows along."They asked, "Messenger of Allah, shall we not fight them?"He replied, "No, not as long as they pray," meaning, whoever hates it in his heart and rejects it in his heart.

Muslim 4801

Sahih

و حدثني أبو غسان المسمعي ومحمد بن بشار جميعا عن معاذ واللفظ لأبي غسان حدثنا معاذ وهو ابن هشام الدستوائي حدثني أبي عن قتادة حدثنا الحسن عن ضبة بن محصن العنزي

عن أم سلمة

زوج النبي ﷺ عن النبي ﷺ أنه قال إنه يستعمل عليكم أمراء فتعرفون وتنكرون فمن كره فقد برئ ومن أنكر فقد سلم ولكن من رضي وتابع قالوا يا رسول الله ألا نقاتلهم قال لا ما صلوا أي من كره بقلبه وأنكر بقلبه

مسلم 4801صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Obligation to denounce rulers for what contradicts the Sharia while refraining from fighting them as long as they pray, and similar matters
Numbering
Darussalam 4801
Muslim 4801