According to a narration one day Hadhrat Bayazid Bastami rahmatullah alayhi while in meditation, he heard a voice asking him to dress as Jew and go to a synagogue. At first he thought it was the mischief of Satan but when he kept on hearing the voice over and over again, he decided to enact it. So, he dressed himself as a Jew and went to their synagogue.
When the Jews and their scholars were present, their chief Rabbi didn’t speak for long. After a while one of the Jews said why are you not addressing us. The Chief Rabbi said “In this gathering there is a follower of the Prophet Muhammed (sallalahu alayhi wasallam.”
The Rabbi then said, “Oh follower of Muhammad (sallalahu alayhi wasallam). For the sake of your Prophet please stand up in your place. If you can remove our doubt about Islam then we shall accept Islam, but if you can’t, then we shall kill you.” On hearing this, Hadhrat Bayazid rahmatullah alayhi stood up and gave permission for them to question him.
The Rabbi asked several questions which Hazrat Bayazid (RA) answered all.
After that Hadhrat Bayazid rahmatullah alayhi said, “Now you give me the answer to my one question. What is the key to paradise?”
No one could answer the question on which Hadhrat Bayazid said ‘The key to paradise is ‘La ilaha illallah Muhammadur Rasoolullah – There is no God worthy of worship except Allah and Muhammad peace be upon him is His Messenger!”
On hearing this the whole gathering accepted Islam.