It was narrated from Abu Hurairah that the Messenger of Allah (ﷺ) said:"There are three to whom Allah will not speak on the Day of Resurrection, nor will He look at them or purify them, and theirs will be a painful torment: A man who has surplus water in the desert but refuses to give any to a wayfarer; a man who sells a product to a man after 'Asr and swears by Allah that he bought it for such and such amount, and he believes him, when that is not the case; and a man who swears allegiance to a ruler, and only does so for worldly gains, so if he gives him some of (these worldly benefits) he fulfills his oath of allegiance, and if he is not given anything he does not uphold his oath of allegiance
Hadith No. 2207
Sunan Ibn Majah
Gradings:
Al-Albani:
Sahih
Muhammad Fouad Abd al-Baqi:
Sahih
Shuaib Al Arnaut:
Sahih
Zubair Ali Zai:
Sahih Muslim