There is No Contradiction
Question :
Is this Hadith authentic:
"I have been ordered to fight the people until they say: "None has the right to be worshipped but Allah and Muhammad is the Messenger of Allah."
And doesn't is contradict the following verse:
"And fight in the way of Allah those who fight you, but transgress not the limits. Truly, Allah likes not the transgressor."
Answer:
This Hadith is authentic; there are many other Hadiths that convey a similar meaning, and there is no contra- diction between the Hadith and the noble verse in which Allâh Almighty said:
"And fight in the way of Allah those who fight you".
For it refers to the disbelievers and the idolators. For they do not say: "None has the right to be worshipped but Allâh" nor apply it. So fighting them is Jihad in the way of Allah. The same applies to those who say "None has the right to be worshipped but Allah," but do not fulfil its rights, avoiding some pillars of the religion, or being quick to legalize what is unlawful: fighting them is also Jihad in the way of Allah, due to the Prophet's ﷺ saying (in the narration in question):
"except for its rights."
Source:
Ibn Jibreen
Fatawa Islamiyah, Vol. 7 Pages 169-170