From Sahih Bukhari (Hadith 2959):
Narrated `Abdullah bin Zaid:that in the time (of the battle) of Al-Harra a person came to him and said, "Ibn Hanzala is taking the pledge of allegiance from the people for death." He said, "I will never give a pledge of allegiance for such a thing to anyone after Allah's Messenger (ﷺ)
Reference: Bukhari 2959