Sahih Muslim 108a
Abu Huraira narrated on the authority of Abu Bakr that the Messenger of Allah ﷺ said: Three are the persons with whom Allah would neither speak on the Day of Resurrection, nor would He look towards them, nor would purify them (from sins), and there would be a tormenting chastisement for them: a person who in the waterless desert has more water (than his need) and he refuses to give it to the traveller and a person who sold a commodity to another person in the afternoon and took an oath of Allah that he had bought it at such and such price and he (the buyer) accepted it to be true though it was not a fact, and a person who pledged allegiance to the Imam but for the sake of the world (material gains). And if the Imam bestowed on him (something) out of that (worldly riches) he stood by his allegiance and if he did not give him, he did not fulfil the allegiance.
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَأَبُو كُرَيْبٍ قَالاَ حَدَّثَنَا أَبُو مُعَاوِيَةَ، عَنِ الأَعْمَشِ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، - وَهَذَا حَدِيثُ أَبِي بَكْرٍ - قَالَ قَالَ رَسُولُ اللَّهِ ﷺ " ثَلاَثٌ لاَ يُكَلِّمُهُمُ اللَّهُ يَوْمَ الْقِيَامَةِ وَلاَ يَنْظُرُ إِلَيْهِمْ وَلاَ يُزَكِّيهِمْ وَلَهُمْ عَذَابٌ أَلِيمٌ رَجُلٌ عَلَى فَضْلِ مَاءٍ بِالْفَلاَةِ يَمْنَعُهُ مِنِ ابْنِ السَّبِيلِ وَرَجُلٌ بَايَعَ رَجُلاً بِسِلْعَةٍ بَعْدَ الْعَصْرِ فَحَلَفَ لَهُ بِاللَّهِ لأَخَذَهَا بِكَذَا وَكَذَا فَصَدَّقَهُ وَهُوَ عَلَى غَيْرِ ذَلِكَ وَرَجُلٌ بَايَعَ إِمَامًا لاَ يُبَايِعُهُ إِلاَّ لِدُنْيَا فَإِنْ أَعْطَاهُ مِنْهَا وَفَى وَإِنْ لَمْ يُعْطِهِ مِنْهَا لَمْ يَفِ " .