Kitab al-Kafi
Ja'far al-Sadiq narrates in Kitab al-Kafi that after entering the sacred Mosque in Mecca, Ali, Hasan ibn Ali, and Husayn ibn Ali were visited by a good looking, well dressed man who asked them a series of questions. Hasan answered the questions and upon this, the man testified to the prophet-hood of Muhammad followed by testifying that Ali and his Ahl al-Bayt are the successors and heir to his message. Ali asked Hasan to track the whereabouts of the visitor, but when he could not, Ali revealed the identity of the man to be Khidr.