I said, "Messenger of Allah, we pass by people who neither host us as guests nor fulfill the rights we have over them, and we do not take anything from them."The Messenger of Allah ﷺ replied, "If they refuse anything except that you take it by force, then take it."
حدثنا قتيبة حدثنا ابن لهيعة عن يزيد بن أبي حبيب عن أبي الخير
قلت يا رسول الله إنا نمر بقوم فلا هم يضيفونا ولا هم يؤدون ما لنا عليهم من الحق ولا نحن نأخذ منهم فقال رسول الله ﷺ إن أبوا إلا أن تأخذوا كرها فخذوا
No references are available.
[Sahih] Bukhari narrated it in "Manners," chapter "Honoring the guest and serving him personally... etc.," hadith no. 6137, and Muslim, hadith no. 1727, from the hadith of Layth bin Saad, from Yazid bin Abu Habib, with this wording.