“A good hadith.”
I say: Rather, it is authentic. Jarīr also corroborated al-Ḥasan ibn ʿUbayd Allāh through the same chain, with the second wording, except that he said, “has committed disbelief,” without expressing uncertainty. Al-Ḥākim recorded it and said: “Authentic according to the criteria of al-Bukhārī and Muslim,” and al-Dhahabī concurred.
I say: It meets Muslim’s criteria only, for this al-Ḥasan—the Nakhaʿī—was not narrated from by al-Bukhārī. However, he was corroborated, as will follow. ʿAbd al-Raḥīm ibn Sulaymān also corroborated al-Ḥasan through the same chain. Ibn Ḥibbān recorded it (1177), with the wording: “A man swore by the Kaʿbah, whereupon Ibn ʿUmar said: ‘Woe to you! Do not do so, for I heard the Messenger of Allah, peace and blessings be upon him, say: Whoever swears by other than Allah has committed associationism.’”
Aḥmad (2/34, 69, 86), al-Ṭaḥāwī in Mushkil al-Āthār (1/357–359), and al-Baghawī (925) also recorded it through other routes from Saʿd ibn ʿUbaydah, through the same chain. In one wording recorded by Aḥmad: “Whoever swears by anything besides Allah, Exalted is He, has committed associationism.” Its chain of transmission is authentic according to the criteria of al-Bukhārī and Muslim. He also has another route in al-Musnad from Ibn ʿUmar; see al-Irwāʾ (2627).
A point of benefit: Abū Jaʿfar al-Ṭaḥāwī said: “What is not meant by this is the associationism that causes one to leave Islam, such that its perpetrator becomes outside Islam. Rather, what is meant is that one should not swear by other than Allah, Exalted is He, because whoever swears by other than Allah”