Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) relates that the Messenger of Allah (peace and blessings be upon him) stayed in Makkah for ten years. He (peace and blessings be upon him) would meet people in their dwellings, at the market of Ukaz and at Majannah, and during the Hajj season (at various places), saying: "Who will help me so that I may convey the message of Allah? And for him is Paradise." (The narrator says that eventually) we said (among ourselves): "(How long) will we leave the Messenger of Allah (peace and blessings be upon him) alone, wandering in the mountains of Makkah and fearing (his enemies)?" So seventy of our men went during the Hajj season, and we agreed to meet him at the Shi'b (valley) of al-Aqabah. When we had gathered there, we asked him (peace and blessings be upon him): "On what shall we pledge allegiance to you?" He (peace and blessings be upon him) said: "Pledge allegiance to me that you will hear and obey (me) in every state, that you will spend (in the way of Allah) in hardship and in ease, that you will enjoin what is right and forbid what is wrong, that you will speak (the truth) regarding Allah without fearing the blame of any blamer, that you will help me when I come to you, and that you will defend me just as you defend yourselves, your wives and your children (and for you is Paradise)." So we pledged allegiance to him (peace and blessings be upon him) on these matters.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16556