It was said to Ibn Umar (may Allah be pleased with them both): When we go in to the rulers, we say things to them that we do not say once we have left them. He said: "In the time of the Messenger of Allah (peace and blessings be upon him), we used to count that as hypocrisy."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13491