كتاب المقدمات
The Book of Miscellany
(80)
Chapter: Obligation of Obedience to the Ruler in what is Lawful and Prohibition of Obeying them in what is Unlawful
(80)
- باب وجوب طاعة ولاة الأمر في غير معصية وتحريم طاعتهم في المعصية
Riyad as-Salihin 663
Ibn 'Umar (May Allah be pleased with them) reported:
Whenever we took a pledge of allegiance to Messenger of Allah (ﷺ) to hear and obey, he (ﷺ) would say to us, "As far as you are capable of."

[Al-Bukhari and Muslim].

وعنه قال‏:‏ كنا إذا بايعنا رسول الله صلى الله عليه وسلم على السمع والطاعة يقول لنا‏:‏ “فيما استطعتم” ‏(‏‏(‏متفق عليه‏)‏‏)‏
Reference : Riyad as-Salihin 663
In-book reference : Introduction, Hadith 663