Ruby 3 How to get username and password from Ruby app DB and post them to Joomla admin login

I have a model in my RoR app. Two of the attributes of this model is username and password, which are the login details of an already installed Joomla site. I would like to use a form in RoR app and when the user click on the submit button to get these details from my app and post them to Joomla login form and submit to login to Joomla backend. I am searching about the method i should use. If i have to use Javascript, which is the way to do it?

I have some knowledge in RoR but never done something like this before.

Thank you very much, in advance.