The Messenger of Allah ﷺ said, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah."
حدثنا أبو بكر بن أبي شيبة حدثنا أبو معاوية ووكيع عن الأعمش عن أبي صالح
قال رسول الله ﷺ من أطاعني فقد أطاع الله ومن عصاني فقد عصى الله
[Sahih] Ahmad narrated it (2/252-253) from Abu Muawiya and Waki, and the hadith has many routes in Bukhari, no. 2957, and Muslim, no. 1835, and others.