Hadith on Obedience: Obey Allah, His Messenger, authorities as much as you can

Abdullah ibn Umar reported: When we pledged allegiance to the Messenger of Allah, peace and blessings be upon him, on condition of listening and obeying, he said to us, “As much as you are able.

Source: Ṣaḥīḥ al-Bukhārī 7202, Ṣaḥīḥ Muslim 1867

Grade; Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim

عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ قَالَ كُنَّا إِذَا بَايَعْنَا رَسُولَ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ عَلَى السَّمْعِ وَالطَّاعَةِ يَقُولُ لَنَا فِيمَا اسْتَطَعْتُمْ

7202 صحيح البخاري كتاب الأحكام باب كيف يبايع الإمام الناس

1867 صحيح مسلم كتاب الإمارة باب البيعة على السمع والطاعة فيما استطاع