Apple - How to automatically login to captive portals on OS X?

Just found this Disable Captive Network Support in OS X

Which mentions "To disable it, set this preference:"

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -boolean false

In case, you would ever want to remove this setting, you can do:

sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.captive.control Active

Then, as @Leon mentions, use the regular web browser to login. Or if you are on a network where that somehow does not work then you can still try and open the app manually ( located at /System/Library/CoreServices/Captive Network Assistant.app )


Update: note that question was asked and answered in 2012, a lot has changed in the OS since that time, including SIP, which prevents the renaming proposed here. The answer below by @cwd is now the recommended way as it doesn't need disabling of SIP...

You can rename

/System/Library/CoreServices/Captive Network Assistant.app

into

/System/Library/CoreServices/No More Captive Network Assistant.app

and you're all set. Password entering now goes via your browser of choice and can be stored using 1password or other plugins. Note that if you were already logged in while doing the renaming, it may take some time for your session to expire...


Tyilo's NetworkAutoLogin project on github is an os.x daemon that "Automagically logs into to Captive Portal Networks" with user-supplied credentials.

It uses PhantomJS & CasperJS to post the necessary info to the fields on the captive portal login page. Could be the secret login "password", a username-password pair, or just activating a EULA checkbox and the "connect" button.

I can't remember exactly how it is triggered, but it registers a .plist with launchctl.

You put configuration options in a json file, specifying the name of the fieldset (optional) on the captive portal page and the necessary fieldname + content pairs (required). Here's an example of the config file stored in ~/.networkautologin.js

{ // Example with all possible options
    match: {
        SSID: ['Example WiFi 1', 'Example WiFi 2'],
        BSSID: '01:23:45:67:89:AB',
        URL: 'http://logon.example.org/?url=http://www.apple.com/library/test/success.html'
    },
    form_selector: 'form#login_form',
    fields: {
        'username': 'test',
        'password': '123123'
    }
}

Tags:

Wifi

Network