Mishkat al-Masabih 3666
‘Ubada b. as-Samit said:
We swore allegiance to God’s Messenger agreeing to hear and obey in time of difficulty and time of ease, in what we liked and what we disliked, to give way to others’ interests, not to dispute about government with those in power, and to say what was right wherever we were, not fearing for God’s sake what anyone who blamed us might say. A version has, “Not to dispute about government with those in power unless you see evident infidelity regarding which you have a proof from God.” 

(Bukhari and Muslim.)
وَعَنْ عُبَادَةَ بْنِ الصَّامِتِ قَالَ: بَايَعْنَا رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَلَى السَّمْعِ وَالطَّاعَةِ فِي الْعُسْرِ وَالْيُسْرِ وَالْمَنْشَطِ وَالْمَكْرَهِ وَعَلَى أَثَرَةٍ عَلَيْنَا وَعَلَى أَنْ لَا نُنَازِعَ الْأَمْرَ أَهْلَهُ وَعَلَى أَنْ نَقُولَ بِالْحَقِّ أَيْنَمَا كُنَّا لَا نَخَافُ فِي اللَّهِ لَوْمَةَ لَائِمٍ. وَفِي رِوَايَةٍ: وَعَلَى أَنْ لَا نُنَازِعَ الْأَمْرَ أَهْلَهُ إِلَّا أَنْ تَرَوْا كُفْرًا بَوَاحًا عِنْدَكُمْ مِنَ اللَّهِ فِيهِ بُرْهَانٌ