Obedience does not earn a right to enter heaven but Jesus teaches that only those who do God's will enter the Kingdom of Heaven.  Faith is God's gift that we must use to accomplish God's will.

8 For it is by grace you have been saved, through faith —and this is not from yourselves, it is the gift of God— 9 not by works, so that no one can boast. 10 For we are God’s handiwork, created in Christ Jesus to do good works, which God prepared in advance for us to do. 

21 “Not everyone who calls out to me, ‘Lord! Lord!’ will enter the Kingdom of Heaven. Only those who actually do the will of my Father in heaven will enter. 

But if the Spirit of Him who raised Jesus from the dead dwells in you, He who raised Christ from the dead will also give life to your mortal bodies through His Spirit who dwells in you.  Therefore, brethren, we are debtors—not to the flesh, to live according to the flesh. For if you live according to the flesh you will die; but if by the Spirit you put to death the deeds of the body, you will live. For as many as are led by the Spirit of God, these are sons of God.

And now, dear children, remain in fellowship with Christ so that when he returns, you will be full of courage and not shrink back from him in shame.
Since we know that Christ is righteous, we also know that all who do what is right are God’s children.

Ephesians 2:8-10
Matthew 7:21
Romans 8:11-14
1st John 2:28,29