We pledged allegiance to the Messenger of Allah ﷺ to listen and obey in hardship and ease, in what we like and what we dislike, even when others are given preference over us, not to dispute authority with those who hold it, and to speak the truth wherever we may be, fearing no one's blame for the sake of Allah.
حدثنا علي بن محمد حدثنا عبد الله بن إدريس عن محمد بن إسحق ويحيى بن سعيد وعبيد الله بن عمر وابن عجلان عن عبادة بن الوليد بن عبادة بن الصامت عن أبيه
بايعنا رسول الله ﷺ على السمع والطاعة في العسر واليسر والمنشط والمكره والأثرة علينا وأن لا ننازع الأمر أهله وأن نقول الحق حيثما كنا لا نخاف في الله لومة لائم
Narrated by Bukhari, in the Book of Rulings, chapter on how the leader takes the pledge of allegiance from the people, hadith no. 7199, from the hadith through the aforementioned chain, and hadith no. 1709, from Yahya. And Muslim, in the Book of Leadership, chapter on the obligation of obeying rulers except in matters of sin, the hadith of Ibn Idris, from the hadith of Ubada bin Walid, with similar wording.