Suwayd bin Ghafalah (may Allah have mercy on him) says that Sayyiduna Umar (may Allah be pleased with him) said to me: O Abu Umayyah! Perhaps caliphs will come over you after me; then obey them, even if it be an Abyssinian slave. If he beats you, or commands you with something, or deprives you, or wrongs you, then be patient. If he commands you with something that diminishes your religion, then say: 'As-sam'u wat-ta'ah' (hearing and obedience) is (offered) with my blood, not with my religion.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16628