Narrated by Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) from the Noble Prophet (peace and blessings of Allah be upon him) that he (peace be upon him) said: "Listening to and obeying (the Imam's command) is obligatory upon everyone, as long as it is not against the Shari'ah. But if one is ordered to commit a sin, then neither listening nor obeying is necessary."