I saw a group of people at the Kaaba, so I sat down with them, and there was a man speaking to them. It turned out to be Abdullah bin Amr. He said, "We set out with the Messenger of Allah ﷺ on a journey and camped at a certain place. Some of us were pitching tents, some were tending their livestock, and some were competing at archery, when the Messenger of Allah's caller announced that we should gather for prayer. I came to him and found him addressing the people, saying,'People, there has never been a prophet before me who was not obliged to guide his community to what he knew was good for them and to warn them against what he knew was harmful to them. Know that the well-being of this community lies in its earliest part, while its later part will be struck by trials and afflictions, each one making the one before it seem slight. A trial will come and the believer will say, this will be my ruin, and then it will pass. Then another will come and he will say, this one, this is it. Then another will come and he will say, this one, this is it. Then it will pass. So whoever wishes to be kept far from the Fire and admitted to the Garden, let death find him believing in Allah and the Last Day, and treating people as he would wish to be treated. And whoever pledges allegiance to a leader, giving him his handclasp and the sincerity of his heart, let him obey him if he is able.'"On another occasion he said, "as much as he is able."When I heard this, I pushed my head between two men and said, "But your cousin Muawiya commands us to do such things."He placed his fist against his forehead, lowered his head for a moment, then raised it and said, "Obey him in what is obedience to Allah, and disobey him in what is disobedience to Allah."I asked him, "Did you yourself hear this from the Messenger of Allah ﷺ?"He replied, "Yes, my own two ears heard it."
حدثنا إسماعيل بن عمر أبو المنذر حدثنا يونس بن أبي إسحاق حدثني عبد الله بن أبي السفر عن الشعبي عن عبد الرحمن بن عبد رب الكعبة الصائدي قال رأيت جماعة عند الكعبة فجلست إليهم فإذا رجل يحدثهم فإذا هو عبد الله بن عمرو قال خرجنا مع رسول الله ﷺ في سفر فنزلنا منزلا فذكر الحديث
Its isnad is sahih, and it is a repetition of the previous one. Muslim also narrated it, 2:88, from Muhammad bin Rafi, from Abu Mundhir Ismail bin Umar, with this isnad.