I have a test REST api and backbone application up and running. The problem is that I need to send api login credentials with every api call from backbone. This in itself is not the problem, but it means that I have to store the api login credentials in the javascript code in my backbone.js. So if someone was curious they could just look at the backbone/javascript code and see the api credentials.
But at the same time, I understand to follow REST principles, all api calls should include login information so as to not carry over any state from previous calls. How is this addressed with backbone? I hope that it is not with sessions on the server, because that would be against REST.
I haven't been able to find much info on this topic so I may be way off.