Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates from Sayyiduna Umar (may Allah be pleased with him) that he said: "O company of the Ansar! O assembly of the Muslims! Indeed, the most deserving of people of the affair (the caliphate) of the Prophet of Allah (peace and blessings be upon him) is the one who was 'the second of the two when they were in the cave', that is, Sayyiduna Abu Bakr (may Allah be pleased with him), who is the foremost and the steadfast." Then I took hold of his hand, and a man from the Ansar got ahead of me and struck his hand on his hand (pledging allegiance) before I could pledge, then I struck my hand on his hand, and the people pledged allegiance one after another.
And it is said that Sayyiduna Bashir bin Sa'd al-Ansari Abu al-Nu'man (may Allah be pleased with him) was the first person to pledge allegiance to Sayyiduna Abu Bakr al-Siddiq (may Allah be pleased with him).
Related hadith on this topic