If you’re at one of the many UK universities which have outsourced their student accommodation internet packages to Keycom, you may have become very familiar with a page that looks something like this:
Using possibly the most annoying way to do authentication ever, Keycom makes you enter a username and password by force-redirecting you every time you decide to connect to the wireless network, or indeed the wired network, in the flat you’re paying to live in. This means that, should the web server Keycom are using to serve this page break (and it has), we all lose internet access. Keycom also enforce this by blocking all alternative DNS servers – a query made to Google Public DNS through their network will be responded to by, yes, the Keycom DNS server. All in the name of trying to get you to pay £100 for 1 academic year’s worth of 50Mbps internet (an offer which I lacked the capacity to refuse).
But I digress. As any good programmer will know, a problem like this can be easily fixed. You know exactly when it’s going to happen (every time you connect to the wireless or wired network in your flat) and you know exactly how to resolve it (enter your username and password).
So we just have to get your Android device to solve the problem using a program, rather than having you open up the browser, get redirected, try to remember your password (did I mention you can’t change the password?) and type it in. And here’s where Tasker (£3.99, Android Market) comes in.
Tasker is a relatively small app which can do a whole lot of things. The premise is simple: set up profiles for when something happens, link the profile to a task, and Tasker will perform the task when the thing happens.
Once you’ve downloaded Tasker, opened it, and got past the introductory screens, you should reach something like this:
To begin, tap the + icon to add a new profile. It will ask you to enter a name – I’m just going to call this one ‘Keycom’.
Select State from the context menu, then Net from the menu that appears. Since we want this action to run after we’ve connected to the network, tap Wifi Connected from this menu.
Since we only want this to run when we connect to the Keycom wireless, we’ll enter its SSID into the top SSID field: ‘KeySurf’. You could alternatively enter the MAC address of the router in your flat if you knew it, but this way it works with any KeySurf wireless (such as if you visited a friend in university accommodation).
You will then be prompted to add a task by Tasker. I’m just going to use the name ‘Keysurf Login‘.
Tap the + button to add an action to the task, and choose Net then HTTP POST from the menu that appears. As the login form you’re redirected to uses HTTP POST to send data to a server, all we’re doing here is emulating its behaviour. We just need to tell it what data to send, and where. This information comes directly from the HTML login form itself – this is how the opening tag looks in the HTML source:
<form action="/goform/HtmlLoginRequest" method="post">
This tells us we need to submit the form data to the URL “/goform/HtmlLoginRequest” (located on the same server as the login form page) using HTTP POST. In addition, the username and password fields are as follows:
<input type="text" name="username" class="shadowbox" />
<input type="password" name="password" maxlength="16" class="shadowbox />
Here, the name option is the important bit. These are the variables to POST to the server. These can be called anything, but – like many websites – Keycom opt for lowercase “username” and “password”.
We can gather from the above, then, that we need the following data:
Server:Port: login.keycom.co.uk:8080 (this is the server where the login form, and therefore the place to POST our data, is located)
Path: goform/HtmlLoginRequest (no trailing slash. The login form POSTs to this URL to log you in, so we will send the same data there)
Data: username=(your username)
password=(your password)
(each variable should be entered on a new line)
Once you have filled in these three fields (you can ignore the rest), confirm the action using the green tick button and then confirm the task you added the action to. Connecting to a wireless network named KeySurf should then trigger the Keycom profile, and sign you in to Keycom automatically.
Unfortunately, this will only work for an Android device. It will not log you in on any other device (even if you’re already logged in on the device) – though I am working on getting a script that does the same thing on Linux.






