For dev scenarios, you can pass the user id/password as Samuli has mentioned.
But for productive purpose, i think you should look at Single signing on from your front end server to Portal. Assuming you have a MS sharepoint, you can use SAML2 based authentication.
Sharepoint will authenticate the user, generate an artifact and pass it onto Portal. once portal verifies the user, it will again create SSO with the Gateway server.
In this way, you do not have to mention any id/password in your code.