{"id":107,"date":"2009-10-12T18:46:58","date_gmt":"2009-10-12T17:46:58","guid":{"rendered":"http:\/\/blogs.oucs.ox.ac.uk\/networks\/?p=107"},"modified":"2009-10-12T18:49:03","modified_gmt":"2009-10-12T17:49:03","slug":"fixing-the-iphone-os-wifi-auto-login-problem","status":"publish","type":"post","link":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/2009\/10\/12\/fixing-the-iphone-os-wifi-auto-login-problem\/","title":{"rendered":"Fixing the iPhone OS WiFi auto-login problem"},"content":{"rendered":"<p>Some time ago, shortly after iPhone OS 3.0 was released, we received a number of reports from users that our VPN-based wireless service had become unusable. For those not familiar with this service, OWL is one of our local wireless networks that permits VPN access for university members whilst providing a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Captive_portal\" target=\"_blank\">captive-portal<\/a> for visitors. Normally the dual-use works quite well: university members start the VPN client and visitors start a web browser to log in.<\/p>\n<p>Not so for OS 3.0 users though, who joined the wireless service only to be automatically shown the visitor login page, and then when they closed that down the iPhone or iPod Touch would just disconnect from OWL in a huff. There was no opportunity to start the VPN client.<\/p>\n<p>A mail list post by James Hooper, a Network Specialist at Bristol University, explained all: it seems the device tests for Internet connectivity by attempting to retrieve a specific web page. So all we need to do is trick OS 3.0 into thinking this page is accessible.<\/p>\n<p>According to James, the page in question lives at <a title=\"Apple iPhone OS 3.0 Internet test page\" href=\"http:\/\/www.apple.com\/library\/test\/success.html\" target=\"_blank\">http:\/\/www.apple.com\/library\/test\/success.html<\/a> and should return the following, to be considered a success:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE HTML PUBLIC &quot;-\/\/W3C\/\/DTD HTML 3.2\/\/EN&quot;&gt;\r\n&lt;HTML&gt;\r\n&lt;HEAD&gt;\r\n&lt;TITLE&gt;Success&lt;\/TITLE&gt;\r\n&lt;\/HEAD&gt;\r\n&lt;BODY&gt;\r\nSuccess\r\n&lt;\/BODY&gt;\r\n&lt;\/HTML&gt;\r\n<\/pre>\n<p>We know that all clients attempting HTTP requests on OWL will hit our captive portal web servers. These servers are already configured to capture URLs and redirect clients to the Visitor Network login page. All we need do is configure those servers to first check for a request to <em>success.html<\/em> and return the fake content instead. The excellent <em>mod_rewrite<\/em> Apache module comes to our rescue, and we end up configuring something like the following:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\n# apple captive portal detection\r\nRewriteRule\u00a0\u00a0\u00a0 ^\/library\/test\/success.html$\u00a0\u00a0\u00a0 -\u00a0\u00a0\u00a0 &#x5B;L]\r\n<\/pre>\n<p>The above line tells Apache that if the request matches this text, then it should stop processing and serve the file locally (a copy of <em>success.html<\/em> is saved on the server<em>)<\/em>. Just after that instruction, we capture every other request and issue a 302 redirect to the captive portal login page.<\/p>\n<p>I&#8217;m told that Apple did acknowledge this bug, and perhaps even fixed it in OS 3.1, although brief tests were not conclusive. Regardless, it&#8217;s better for us to leave this monkeypatching in place to avoid users having further difficulties in connecting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago, shortly after iPhone OS 3.0 was released, we received a number of reports from users that our VPN-based wireless service had become unusable. For those not familiar with this service, OWL is one of our local wireless &hellip; <a href=\"https:\/\/blogs-new.it.ox.ac.uk\/networks\/2009\/10\/12\/fixing-the-iphone-os-wifi-auto-login-problem\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[126,12],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-vpn-services","category-wireless"],"_links":{"self":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":26,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":1934,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/posts\/107\/revisions\/1934"}],"wp:attachment":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/networks\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}