I would like to login to an external https site, through rails based on user/password credentials saved into a rails database. Something like a single sign on. The external site does not provide an API to login; only a login form. Their docs say you can post the credentials to their login form by loading the email and password to the form and then pressing ok. 

But if I do that, then by viewing the source code of the login form, someone may find out the login credentials. I have looked into Mechanize and loading cookies like here [Submitting POST data from the controller in rails to another website](https://stackoverflow.com/questions/1195962/submitting-post-data-from-the-controller-in-rails-to-another-website) and [Rails 3 - Log into another site and keep cookie in session](https://stackoverflow.com/questions/17005921/rails-3-log-into-another-site-and-keep-cookie-in-session) but it does not seem right. 

Is there a way to automatically load the credentials from the controller and post to the external site immediately in order to login to that site?

Thank you in advance