Qays bin Amr reported,

We pledged allegiance to the Messenger of Allah ﷺ to hear and obey, in our hardship and our ease, in what delights us and what we dislike, and even when others are preferred over us, and that we would not contest authority with those who hold it, and that we would stand firm with the truth wherever it may be, fearing no blame from anyone for the sake of Allah.Shuba said that Sayar did not mention the phrase "wherever it may be," but Yahya did mention it. Shuba said, "If I have added anything to it, it is from Sayar or from Yahya."

Nasai 4159

Sahih

أخبرنا محمد بن الوليد قال حدثنا محمد قال حدثنا شعبة عن سيار ويحيى بن سعيد أنهما سمعا عبادة بن الوليد يحدث عن أبيه أما سيار فقال عن أبيه وأما

يحيى فقال عن أبيه عن جده قال

بايعنا رسول الله ﷺ على السمع والطاعة في عسرنا ويسرنا ومنشطنا ومكرهنا وأثرة علينا وأن لا ننازع الأمر أهله وأن نقوم بالحق حيثما كان لا نخاف في الله لومة لائم قال شعبة سيار لم يذكر هذا الحرف حيثما كان وذكره يحيى قال شعبة إن كنت زدت فيه شيئا فهو عن سيار أو عن يحيى

النسائي 4159صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Pledge of allegiance
Chapter
Pledge of allegiance despite preference being given to others
Numbering
Darussalam 4159
Nasai 4159