Sahih Muslim Book 27, Hadith 3
Salim reported on the authority of his father that Allah's Apostle (ﷺ) heard 'Umar while he was taking oath by his father. The rest of the hadith is the same.
" I did not take oath by (anyone else except Allah) since I heard Allah's Messenger forbidding it. nor did I speak in such terms, and the narrator did not say," on my own behalf or on behalf of someone else".
'Abdullah (b. Umar) reported that Allah's Messenger (ﷺ) found, Umar b. al-Khattab amongst the riders and he was taking oath by his father Allah's Messenger (ﷺ) called them (saying) ; Our Allah, the Exated and Majestic, has forbidden you that you take oath by your father. He who bag to take an oath, he must take it by Allah or keep quiet.