The Book of the Prohibited actions
Riyad as-Salihin #862
كتاب الأمور المنهي عنها
وعن محمد بن زيد أن ناسًا قالوا لجده عبد الله بن عمر رضي الله عنهما: إنا ندخل على سلاطيننا فنقول لهم بخلاف ما نتكلم إذا خرجنا من عندهم. قال: كنا نعد هذا نفاقًا على عهد رسول الله صلى الله عليه وسلم. ((رواه البخاري)).
Muhammad bin Zaid reported:
Some people said to my grandfather, 'Abdullah bin 'Umar (May Allah be pleased with them): We visit our rulers and tell them things contrary to what we say when we leave them. 'Abdullah bin 'Umar (May Allah be pleased with them) replied: “In the days of the Messenger of Allah (ﷺ), we counted this act as an act of hypocrisy.”.
وعن محمد بن زيد أن ناسًا قالوا لجده عبد الله بن عمر رضي الله عنهما: إنا ندخل على سلاطيننا فنقول لهم بخلاف ما نتكلم إذا خرجنا من عندهم. قال: كنا نعد هذا نفاقًا على عهد رسول الله صلى الله عليه وسلم . ((رواه البخاري)).
Some people said to my grandfather, 'Abdullah bin 'Umar (May Allah be pleased with them): We visit our rulers and tell them things contrary to what we say when we leave them. 'Abdullah bin 'Umar (May Allah be pleased with them) replied: "In the days of the Messenger of Allah (ﷺ), we counted this act as an act of hypocrisy.".
— Riyad as-Salihin, Hadith 862