Imam Moslem narrated in “Sahih” (Book 017, Number 4231):
Hudain b. al-Mundhir Abu Sasan reported: I saw that Walid was brought to Uthmin b. ‘Affan as he had prayed two rak’ahs of the dawn prayer, and then he said: I make an increase for you. And two men bore witness against him. One of them was Humran who said that he had drunk wine. The second one gave witness that he had seen him vomiting. Uthman said: He would not have vomited (wine) unless he had drunk it. He said: ‘Ali, stand up and lash him. ‘Ali said: Hasan, stand up and lash him. Thereupon Hasan said: Let him suffer the heat (of Caliphate) who has enjoyed its coolness. (‘Ali felt annoyed at this remark) and he said: ‘Abdullah b. Ja’far, stand up and flog him, and he began to flog him and ‘Ali counted the stripes until these were forty. He (Hadrat ‘Ali) said: Stop now, and then said: Allah’s Apostle (may peace be upon him) gave forty stripes, and Abu Bakr also gave forty stripes, and Umar gave eighty stripes, and all these fall under the category of the Sunnab, but this one (forty stripes) is dearer to me.
Imam Abu Dawud as-Sijistane narrated in his “Sunnan” (Book 38, Number 4465):
Narrated Ali ibn AbuTalib:
Hudayn ibn al-Mundhir ar-Ruqashi, who was AbuSasan, said: I was present with Uthman ibn Affan when al-Walid ibn Uqbah was brought to him. Humran and another man bore witness against him (for drinking wine). One of them testified that he had seen him drinking wine, and the other testified that he had seen him vomiting it.
Uthman said: He could not vomit it, unless he did not drink it. He said to Ali: Inflict the prescribed punishment on him. Ali said to al-Hasan: Inflict the prescribed punishment on him.
Al-Hasan said: He who has enjoyed its pleasure should also bear its burden. So Ali said to Abdullah ibn Ja’far: Inflict the prescribed punishment on him. He took a whip and struck him with it while Ali was counting.
When he reached (struck) forty (lashes), he said: It is sufficient. The Prophet (peace_be_upon_him) gave forty lashes. I think he also said: “And Abu Bakr gave forty lashes, and Uthman eighty. This is all sunnah (standard practice). And this is dearer to me.”
And he also narrated (Book 38, Number 4466):
Narrated Ali ibn AbuTalib:
The Apostle of Allah (peace_be_upon_him) and AbuBakr gave forty lashes for drinking wine and Umar made it eighty. And all this is sunnah, the model and standard practice.
Both of hadith are sahih. (see “Sahih Sunnan Abu Dawud” by Albani 4480, 4481)
Imam Nawavi said:
“This narration is manifest proof that Ali (r.a) honoured the actions and commandments of Umar and Abu Bakr by acknowledging their actions as a Sunnah, contrary to the lies which the shias ascribe to him”.
(quoted from footnote at pages 90-91, from the book “Iqamil Hujjah ‘Ala Anna Ikthar Fil ta’abud Laysa Bi Bid’at” (in english) by imam Abul Hasanat Abdulhai al-Lucknawi, printed by al-Hamra publication).