Al-Kāfi - Volume 1 > Tacit and Explicit Testimony as proof of abu Muhammad al-Hassan ‘s (a.s.) Divine Authority over the people after Ali ibn Muhammad (a.s.)
Hadith #9

9ـ عَلِيُّ بْنُ مُحَمَّدٍ عَنْ إِسْحَاقَ بْنِ مُحَمَّدٍ عَنْ مُحَمَّدِ بْنِ يَحْيَى بْنِ دَرْيَابَ قَالَ دَخَلْتُ عَلَى أَبِي الْحَسَنِ (عَلَيْهِ السَّلام) بَعْدَ مُضِيِّ أَبِي جَعْفَرٍ فَعَزَّيْتُهُ عَنْهُ وَأَبُو مُحَمَّدٍ (عَلَيْهِ السَّلام) جَالِسٌ فَبَكَى أَبُو مُحَمَّدٍ (عَلَيْهِ السَّلام) فَأَقْبَلَ عَلَيْهِ أَبُو الْحَسَنِ (عَلَيْهِ السَّلام) فَقَالَ لَهُ إِنَّ الله تَبَارَكَ وَتَعَالَى قَدْ جَعَلَ فِيكَ خَلَفاً مِنْهُ فَاحْمَدِ الله.

9. Ali ibn Muhammad has narrated from Ishaq ibn Muhammad from Muhammad ibn Yahya ibn Daryab who has said the following. “I went to see abu al-Hassan (a.s.) after the death of abu Ja‘far and offered condolences for this reason. Abu Muhammad (a.s.) was also present. He wept and abu al-Hassan (a.s.) turned to him and said, “Allah, the Most Holy, the Most High, has made you to succeed (the Imam) instead of him. You must thanks Allah.”