Sayyiduna ‘Ubada bin Samit (may Allah be pleased with him) narrates this statement of the Noble Prophet (peace and blessings be upon him): "Obey (the ruler of the time) in hardship and ease, in what you like and dislike, and even if he gives preference to others over you (in all circumstances, obey him); if he takes your wealth and strikes your back (still obey him), except if he commands something sinful, then do not obey him in that."
Hadith Referenceصحیح ابن حبان / كتاب السير / 4562
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «الظلال» (1026)، «الصحيحة» (3418): ق.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده حسن