1 John 3 KJV
22 And whatsoever we ask, we receive of him, because we keep his commandments, and do those things that are pleasing in his sight. 23 And this is his commandment, That we should believe on the name of his Son Jesus Christ, and love one another, as he gave us commandment.
Those who cried LORD LORD but where rejected tried to justify themselves by the Wonderful works.. They where ( will be since this is prophecy) works salvation believers..
Matthew 7: KJV
21 "¶ Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven. {22} Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works? {23} And then will I profess unto them, I never knew you: depart from me, ye that work iniquity."