App skeleton needed with simple user setting

I have a couple of self-hosted web-applications (each on a different sub-domain) which I have integrated into my nextcloud menu.
First I used the EXTERNAL app which can show the pages and also have customized icons in the menu bar.
But it did not AUTOMATICALLY LOG ME IN to those applications with user name and password if I use different PCs.

So I came up with a range of app skeletons for each application. Each of these custom nextcloud app templates uses a html FORM element which is submitted by JS to the respective application login via POST. In the forms there are INPUTS with hard-coded username and password because I don’t know how to create a settings field in nextcloud user settings to provide a username and password via the user settings page which is then stored in nextcloud database. Very much like the RAINLOOP app does it in user settings.

Just after the html form element which is immediately submitted, my app skeletons load the respective application domains via IFRAME.

The auto-login works now, but hard-coding the credentials in the nextcloud app template code is not a good way to go.

Can anyone help me out how to create a user-setting for each app which stores username and password in nextcloud database ? And it should should avoid any CORS issues if possible when loading the domains via iframe. And if it could even request and return CSRF cookies from the target domain during login POST, I would be really happy.

Thanks in advance