The Messenger of Allah ﷺ said that when Sulayman bin Dawud finished building Bayt al-Maqdis, he asked Allah for three things. He asked Allah
for judgment that would correspond to His own 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 completed the construction of the mosque, he asked Allah
that no one should come to it intending nothing but prayer within it except that he would emerge from his sins as on the day his mother bore 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, who said... and he mentioned it. Its chain is sahih. Ibn Daylami is Abdullah bin Fayruz Daylami, Abu Bisr, whom Ibn Main, Ajli, Ibn Hibban, and others considered reliable.