Jabir quotes from Abu Ja’far: “When Umar asked Hazrat Ali (ra) about Mahdi, he (Umar) said: OIbn Abu Talib (Hazrat Ali), tell me about Mahdi. What is his name?” And Hazrat Ali (ra) said: “My dear, close friend, our Prophet saas) said: “Allah had me promise not to reveal his name to anybody until he would appear. His [Hazrat Mahdi (as)] name is one of the knowledge which Allah entrusted upon His messenger.
(Iqmal al-din) (Gaybah, Allame Muhammad Baqir Majlisi, Ansariyan Publishing , Iran, 2007)
Hazrat Ali (ra), the Lion of Allah (Asadullah), asked our Prophet (saas) to reveal the name of Hazrat Mahdi (as), who will emerge in the End Times and will have the greatest pole and will be the saint (wali) of the End Times. But our Prophet (saas) stated that Hazrat Mahdi’s (as) name would be kept as a secret until Allah would have him emerged and this was a confidential information that Allah had entrusted upon him. We therefore understand that Hazrat Mahdi’s (as) name will be kept as a secret i.e. will be unknown to people until its time to come. That is, Mahdi’s (peace be upon him) name will not be one of the names of our Prophet (saas) such as Ahmad, Mustafa or Muhammad but it will be determined when he (saas) will emerge.