The Messenger of Allah ﷺ came out to us when we were nine, five and four, one group from the Arabs and the other from the non-Arabs. He said, "Listen. Have you heard that there will be rulers after me? Whoever goes in to them, affirms their lies, and assists them in their oppression is not of me, and I am not of him, and he will not come to me at the Pool. But whoever does not go in to them, does not assist them in their oppression, and does not affirm their lies is of me, and I am of him, and he will come to me at the Pool."
حدثنا هارون بن إسحق الهمداني حدثني محمد بن عبد الوهاب عن مسعر عن أبي حصين عن الشعبي عن عاصم العدوي
خرج إلينا رسول الله ﷺ ونحن تسعة خمسة وأربعة أحد العددين من العرب والآخر من العجم فقال اسمعوا هل سمعتم أنه سيكون بعدي أمراء فمن دخل عليهم فصدقهم بكذبهم وأعانهم على ظلمهم فليس مني ولست منه وليس بوارد علي الحوض ومن لم يدخل عليهم ولم يعنهم على ظلمهم ولم يصدقهم بكذبهم فهو مني وأنا منه وهو وارد علي الحوض
[Its chain of transmission is sahih] Nasai narrated it (7/161, no. 4213) (The Pledge of Allegiance, chapter of one who does not assist a ruler in oppression) from Harun bin Ishaq, with this wording, and Ibn Hibban graded it sahih (no. 1571). A group narrated it from Masaar, with this wording, and this hadith has very many chains, see no. 614.There is also a report on this subject from Huzaifa [Muslim, no. 1847, and Ahmad, 5/384] and Ibn Umar [Ahmad, 2/95].