It works by simply replacing the action URL from the login form on the web page to a local HTTP server which redirects the request to the original destination. The local HTTP server saves the request, so the app can reproduce the same call next time you connect to the same WiFi network.
If somebody knows a better way to save the login procedure (without letting the web page executing java code), I would love your contribution.
Or any other contribution is highly appreciated.