The sample code provided below using Javascript that exposes the user credential information is not a good security best practice. Please do not put this into practice.