We pledged allegiance to the Messenger of Allah ﷺ to listen and obey in ease and hardship, in what we like and what we dislike, not to dispute authority with those who hold it, and to speak or stand for the truth wherever we may be, fearing no one's blame.
أخبرنا محمد بن سلمة والحارث بن مسكين قراءة عليه وأنا أسمع عن ابن القاسم قال حدثني مالك عن يحيى بن سعيد قال أخبرني عبادة بن الوليد بن عبادة قال حدثني أبي
بايعنا رسول الله ﷺ على السمع والطاعة في اليسر والعسر والمنشط والمكره وأن لا ننازع الأمر أهله وأن نقول أو نقوم بالحق حيثما كنا لا نخاف لومة لائم
Bukhari narrated it in the Book of Rulings, chapter "How Should the Leader Take the Pledge of Allegiance from People?", h: 7199, 7200, from the hadith of Malik. Muslim narrated it in the Book of Leadership, chapter "The Obligation of Obeying Leaders in Matters Other Than Sin, and the Prohibition of Obeying Them in Sin", vol: 41/1709 onward, h: 1840, from the hadith of Yahya bin Saeed, through the same chain. It is also found in Al-Kubra, h: 7772, and in Muwatta (narration of Abdul-Rahman bin Qasim, p: 523, h: 505).