How will we recognize Al-Mahdi (as) when he reappears? We know that during history there have been many impostors, who have claimed to be (Al Bab) door to Al-Mahdi (as) -like Mirza Ali Mohammed, or to be both Al-Mahdi and Jesus (as), like Ghoulam Ahmed of Qadian, or to be Al-Mahdi (as) himself -like Mohammed Ahmed of Sudan?
We can put this question in a historical context. The American anthropologist L. S. Walbridge formed this question in another way as she wrote:
When the Virgin Mary (as) appeared at Fatima in Lourdes, the children who encountered her were initially denounced by the Church as impostors. The clerical hierarchy knew full well that through the visions of these children, religious power was being transferred from the Church to the “spiritual pure” laity. The Church, unable to discredit the children, ultimately had no choice but to give credence to the apparitions and incorporate reverence and visitations to the sacred sites as part of Church belief. Still, an uneasy relationship is maintained between the clerics and those who experience their deepest religious convictions through the apparitions of The Virgin. The religion that the Virgin Mary (as) represents (the nonconformist, anti establishment religion of the individual) continues to be a threat to the status quo of the Church. In 1960, there was much speculation among American Catholic adults and children alike about what was contained in the letter believed to be given to the oldest child at Lourdes by Mary and passed on to the Pope. Many believed that we were on the eve of enormous political and social change associated with the return of Christ and, by implication, the disempowerment of the Pope and Church hierarchy.
Al-Mahdi, too, may well be seen as the antithesis of established religion and government. His ever-promised appearance holds a latent power as great as, if not greater than, that of the Virgin. The government of Iran, since the Safavid, has had to pay lip service to their belief in him but have always dreaded the announcement that he has appeared. For example, when Ali Muhammed, the Bab, proclaimed in Iran that he was the Mahdi, he was imprisoned and executed in 1850 by Nasser al-Din Shah with the full support of the higher levels of ‘ulama. A substantial number of the lower-ranking ‘ulama, on the other hand, chose to follow the Bab, many of whom were tortured and killed as a result.288 Source: http://www.imamhussain.org