Ubada bin Samit reported,

One of those who witnessed Badr with the Messenger of Allah ﷺ and was among his companions on the night of al-Aqaba reported that the Messenger of Allah ﷺ said, while a group of his companions were gathered around him, "Come and pledge allegiance to me that you will not associate anything with Allah, that you will not steal, that you will not commit adultery, that you will not kill your children, that you will not bring forth a slander you have fabricated between your hands and feet, and that you will not disobey me in what is right. Whoever among you fulfills this pledge, his reward is with Allah. Whoever commits any of these offenses and is punished for it in this world, that punishment is an expiation for him. And whoever commits any of these offenses and Allah conceals it, his affair is left to Allah. If He wills, He will punish him, and if He wills, He will pardon him."He said, "So I pledged allegiance to him on these terms."

Bukhari 3892

Sahih

حدثني إسحاق بن منصور أخبرنا يعقوب بن إبراهيم حدثنا ابن أخي ابن شهاب عن عمه قال أخبرني أبو إدريس عائذ الله أن

عبادة بن الصامت

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

البخاري 3892صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Ansar
Chapter
Delegations of the Ansar to the Prophet ﷺ in Makkah and the pledge of Uqba
Numbering
Darussalam 3892
Bukhari 3892