Obeying tyrants as a religious duty

Who gave this rule and when?
Who defines what is shariah?