Full Sharh — Riyad as-Salihin 1032
وعن ابن عمر رضي الله عنهما أنه سمع رجلا يقول: لا والكعبة، قال ابن عمر: لا تحلف بغير الله، فإني سمعت رسول الله صلى الله عليه وسلم يقول: "من حلف بغير الله، فقد كفر أو أشرك".(( رواه الترمذي وقال حديث حسن)) وفسر بعض العلماء قوله: "كفر أو أشرك" على التغليظ، كما روي أن النبي صلى الله عليه وسلم قال: "الرياء شرك".
English Translation
Ibn 'Umar (May Allah be pleased with them) said:: I heard a man saying: "No, by the Ka'bah." I admonished him: "Do not swear by any thing besides Allah, for I heard the Messenger of Allah (ﷺ) saying, 'He who swears by anyone or anything other than Allah, has indeed committed an act of Kufr or Shirk'."
Source
Riyad as-Salihin(رياض الصالحين)
The Book of the Prohibited actions
Hadith Number
1032