From Sahih Muslim (Hadith 4749):
It has been narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said:Whoso obeys me obeys God; and whose disobeys me disobeys God. Whoso obeys my commander obeys me, and whoso disobeys my commander disobeys me
Reference: Muslim 4749