The specific passage from whence this doctrine comes is this,
For by grace you have been saved through faith. And this is not your own doing; it is the gift of God (Ephesians 2:8)
This was a doctrine Martin Luther struggled with for along time, or, that is, didn't understand. Up unto this point, he believed that one must live a complete and holy life. Which is true if we wish to be holy and acceptable before God Almighty. Luther became a monk so as to attain this but found, rightly so, that his righteousness was as filthy rags (Isaiah 64:6). Everything he did he found was not enough and that to the core, he was a wicked being that had no hope of salvation! That is, until he found Ephesians 2:8. Here we see clearly that our salvation is the gift of God, given us by no merit of our own as Scripture clearly shows! We have done nothing to earn this gift, nay, not even said the word (Ephesians 1:4-6). Though yes, we have responsibility, must keep a healthy balance here, that is for another discussion.
So in summery, our anthem of Salvation by Grace through Faith Alone is merely a summery of Eph 2:8. Salvation by Grace: "For by grace you have been saved". Through Faith: "through faith". Alone: "And this is not of your own doing; it is the gift of God, not a result of works, so that no one may boast" (Eph. 2:9 added for emphasis).
Soli Deo Gloria