According to Gnosticism salvation was not through faith in Jesus's physical death and resurrection but through gaining secret, mystical knowledge about one's true divine origin ("divine spark") and how to escape the material world. This knowledge was often reserved for an enlightened few – Gnosticism identified three types op people: the spiritual (who could achieve gnosis), the psychic (who might be saved through faith and good works), and the material (who were hopelessly bound to the physical world).
John consistently links true knowledge of God with obedience to His commandments and a recognition of one's own sinfulness, rather than a secret, intellectual ascent. He condemns those who claim to know God but live in darkness or deny their sin.
True knowledge (understanding) comes only through Christ
1 John 5:20: We know also that the Son of God has come and has given us understanding, so that we may know him who is true
True knowledge, even of us, comes from God, nowhere else
1 John 3:19,20: This is how we know that we belong to the truth and how we set our hearts at rest in his presence: If our hearts condemn us, we know that God is greater than our hearts, and he knows everything
Salvation comes not though esoteric knowledge, but through Jesus Christ alone
1 John 1:1-2: My dear children, I write this to you so that you will not sin. But if anybody does sin, we have an advocate with the Father – Jesus Christ, the Righteous One. He is the atoning sacrifice for our sins, and not only for ours but also for the sins of the whole world.
Knowledge of God is demonstrated by obedience, not secret insight
1 John 3:10: This is how we know who the children of God are and who the children of the devil are: Anyone who does not do what is right is not God's child, nor is anyone who does not love their brother and sister.
1 John 2:5b,6: This is how we know we are in him: Whoever claims to live in him must live as Jesus did.
1 John 2:3-4: We know that we have come to know him if we keep his commands. Whoever says, "I know him," but does not do what he commands is a liar, and the truth is not in that person.
Salvation comes not through esoteric knowledge, but through doing what is right – contrasting with the Gnostic idea the irrelevance of morality
1 John 3:10: This is how we know who the children of God are and who the children of the devil are: Anyone who does not do what is right is not God's child, nor is anyone who does not love their brother and sister.
John connects fellowship with God with walking in light and acknowledging sin
1 John 1:5-7: This is the message we have heard from him and declare to you: God is light; in him there is no darkness at all. If we claim to have fellowship with him and yet walk in the darkness, we lie and do not live out the truth. But if we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus, his Son, purifies us from all sin.
We have knowledge of and fellowship with God through his Spirit, not secret knowledge
1 John 3:24: And this is how we know that he lives in us: We know it by the Spirit he gave us.