Reputation: 5
Everyday, I have to go through a web based authentication system (firewall) which works likes this:
Once I am connected to the network and I type in any web address say www.google.com
, I am presented with a web based login form (typing any address brings up the same form)
and after submit I get a Authenticated response page from the router with address:
192.168.2.254:1000/keepalive?somejibberjabbernumberwhichchangeseverytime
The page must be refreshed after 200 seconds or else you are logged out. This is done automatically but sometimes it fails.
After that, Internet is enabled and one can browse. I want to make a simple application (java) which does this boring task for me. It will send in my credentials to the server. Log me in. Send refresh command after say 30 seconds automatically.
Are there any suggestions as to how to do this? I need to create a standalone desktop application not a server-side app.
Thanks
Upvotes: 0
Views: 346
Reputation: 1010
So basically, you want to "play browser" with your application? Web testing libraries like httpunit are well suited for such tasks. Basically, that's what you would do:
Have a look at httpunit's cookbook and tutorial, my guess would be that you find all information required for your problem there.
Upvotes: 1