Luke 16:22 - Blessed are ye, when men shall hate you, and when they shall separate you from their company, and shall reproach you, and cast out your name as evil, for the Son of man's sake
Peter 4:14 - If you are insulted because of the name of Christ, you are blessed, for the Spirit of glory and of God rests on you.
Matthew 10:22 - and you will be hated by all for my name’s sake. But the one who endures to the end will be saved.
Not all the exact same thing but the concept is fairly common in Christian scripture and teaching. Basically people will denounce you, hate you, oppose you, and ostracize you for your beliefs, but if you stick to it, you're blessed or favored by God.
Like anything regarding scripture and religion you can interpret this in plenty of ways. Maybe they don't specify what aspects of the faith you must always hold in spite of all else, but the way it's often taught (and as it was presented to me growing up in a Christian community), you must hold to your beliefs in the existence of a God, whose son was Christ, who rose from the dead, and all of the related supernatural implications laid out in the core beliefs of Christianity. People will argue against your beliefs and even persecute you for holding them, but if you want to really prove the strength of your faith and your worthiness as a Christian, you need to stick to your guns.
Either way, it's a matter of debate whether this is a core tenet or not so I'll agree with you there. Still, it's definitely a strong "principle" of many Christian teachings for as far back as the religion has resembled its modern form.