The obligation of obeying leaders in matters that do not involve sin, but it is forbidden to obey them in sinful matters Sahih Muslim 1835 g
Arabic hadith text
وَحَدَّثَنِي أَبُو الطَّاهِرِ، أَخْبَرَنَا ابْنُ وَهْبٍ، عَنْ حَيْوَةَ، أَنَّ أَبَا يُونُسَ، مَوْلَى أَبِي هُرَيْرَةَ حَدَّثَهُ قَالَ سَمِعْتُ أَبَا هُرَيْرَةَ، يَقُولُ عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم بِذَلِكَ وَقَالَ " مَنْ أَطَاعَ الأَمِيرَ " . وَلَمْ يَقُلْ أَمِيرِي وَكَذَلِكَ فِي حَدِيثِ هَمَّامٍ عَنْ أَبِي هُرَيْرَةَ
Translation
According to one version of the tradition, the Messenger of Allah (ﷺ) said
Whoso obeys the commander. He did not say:" My commander."