The Messenger of Allah ﷺ said, "When Sulayman bin Dawud ﷺ built the Sacred House in Jerusalem, he asked Allah for three things. He asked Allah, the Mighty and Majestic, for judgment that would align with His judgment, and it was granted to him. He asked Allah
for a kingdom that would not be fitting for anyone after him, and it was granted to him. And when he finished building the mosque, he asked Allah
that no one come to it intending nothing but to pray within it except that he leave it cleansed of his sins as on the day his mother gave birth to him."
عن رسول الله ﷺ قال: إن سليمان ابن داود ﷺ لما بنى بيت المقدس سأل الله عز وجل خلالا ثلاثة: سأل الله عزوجل حكما يصادف حكمه فأوتيه، وسأل الله عز وجل ملكا لا ينبغي لأحد من بعده فأوتيه، وسأل عز وجل حين فرغ من بناء المسجد أن لا يأتيه أحد لا ينهزه إلا الصلاة فيه أن يخرجه من خطيئته كيوم ولدته أمه.
Nasai (693) narrated it from Amr bin Mansur, who said, Abu Mishar told us, who said, Saeed bin Abdul-Aziz told us, from Rabia bin Yazid, from Abu Idris Khawlani, from Ibn Daylami, from Abdullah bin Amr, and he related it. Its isnad is sahih. Ibn Daylami is Abdullah bin Fayruz Daylami, Abu Bisr, whom Ibn Main, Ajli, Ibn Hibban, and others deemed trustworthy.Uzai narrated it from Rabia bin Yazid but did not mention Abu Idris Khawlani as an intermediary between him and Ibn Daylami. Through this route it was narrated by Imam Ahmad (6644) within a lengthy hadith, by Ibn Hibban (1633), and by Hakim in Mustadrak (2/434), all of them through chains going back to Uzai. Bukhari affirmed in Tarikh al-Kabir (3/288) that Rabia bin Yazid heard directly from Abdullah Daylami, and in Hakim's version there is an explicit statement of his having heard it directly from him.Hakim also narrated it (30/1), pairing Yahya bin Abu Amr Shaybani together with Rabia bin Yazid, both of them saying, Abdullah bin Fayruz Daylami told us, within a lengthy hadith, and he said, This is a sahih hadith, which the leading scholars have transmitted among themselves. Both Bukhari and Muslim relied on all of its narrators, yet neither of them included it, and I am not aware of any defect in it.If this is confirmed, then it should be understood, as is well known in the science of hadith, that Rabia bin Yazid first heard this hadith from Abu Idris Khawlani, from Abdullah Daylami, and then later had the opportunity to hear it directly from Abdullah Daylami, so he transmitted it in two ways.The hadith has other routes as well, and the one I have mentioned is the best of them. Among these other routes is what was narrated by Ibn Majah (1408) and Ibn Khuzayma (1334), both of them from Ubaydullah bin Jahm Anmati, who said, Ayub bin Suwayd told us, from Abu Zura Shaybani, Yahya bin Abu Amr, who said, Ibn Daylami told us, from Abdullah bin Amr, and he related it.Busiri said, "This isnad is daif. Ayub bin Suwayd is unanimously agreed to be daif, and Ubaydullah bin Jahm is unknown."