Ibn Umar heard a man swearing, "No, by the Kaabah."Ibn Umar said to him, "I heard the Messenger of Allah ﷺ say, 'Whoever swears by other than Allah has committed shirk.'"
حدثنا محمد بن العلاء حدثنا ابن إدريس قال سمعت الحسن بن عبيد الله
سمع ابن عمر رجلا يحلف لا والكعبة فقال له ابن عمر إني سمعت رسول الله ﷺ يقول من حلف بغير الله فقد أشرك
Sourcing, its isnad is sahih. Tirmidhi narrated it in Nudhur and Ayman, chapter of what has been said about the one who swears by other than Allah having committed shirk, hadith 1535, from the hadith of Hasan bin Ubaydullah by this route, and he said, "Hasan." Ibn Hibban graded it sahih, hadith 1177, as did Hakim 4/297, and Dhahabi agreed with him.