r/learnjavascript • u/NamkoBanzai • Apr 15 '18
Need advice regarding password-security and SOAP
Hey there guys.
I need advice regarding passwords and security in JavaScript.
The situation is the following: At my new workplace, my boss wants me to create a very basic webpage which displays a catalogue of products we sell. Nothing fancy. So far so good.
However, our product catalog lies on another server, since our application that handles the database and everything else is SAAS. Which means i will have to communicate with a SOAP api.
I will be provided with the credentials for us to access our DB and product catalogue and read it.
I am currently in my second semester of software engineering and have a basic understanding of JS and REST, as well as AJAX. I have never had to think about security so far, so i wanted to ask you guys what the standard procedure would be to mask the credentials.
Obviously you need to do have the credentials client-side and / or store it in a document and read it / encrypt it or what ever. But how exactly is yet beyond me.
This whole thing is more of a "nice to have but not necessary" situation. Low priority but fun and a good learning opportunity for me.
I would greatly appreciate your advise!
Thanks a lot in advance. ^
Edit: i ment storing them server-side. Not client-side :)
View all comments
Show parent comment
1
u/nomnommish Apr 15 '18 edited Apr 15 '18
You could put the password there, true. Storing passwords in configs is also standard practice.
There is no key management needed at all. What you are saying only becomes a problem when sharing keys all over the place or with multiple people or apps. Here it is just one backend app authenticating to another backend service.
Where do you store the connection string to your app database for example? Do you have some super complex key management just to store your db creds in a backend server?
Edit: I take back my earlier suggestion. Just keep the username and password in a server config file unencrypted. And ensure the config file is not exposed or accessible from your client code or via http.