I was tasked to beef up security of a website built with use of Angular v15 + JWT. And the first part was to replace login
POST-request (HTTPS) from this kind:
/api/login?username=user_name&password=pass123
to this kind:
/api/login?credentials=U2FsdGVkX19ViJp9Vr9DiJKq7cjzsR8imgBbrYgxb5rtsBL9D01r
To that end, I added crypto-js
to the client, to encrypt the credentials, while putting the encryption secret code right in JavaScript, which gives me the willies, as secret keys are ordinarily kept on the server only. But in this case it is unavoidable to have them in both server and client.
My question is:
Given the open nature of everything on the client side, is there any recommended approach to at least mediate the security of storing a secret key on the client? Maybe even specifically for Angular.