MediaWiki >= 1.15.3 and MediaWiki >= 1.16.0beta2 now require a login token to be sent when logging in. Please see https://bugzilla.wikimedia.org/show_bug.cgi?id=23076 for more details. The MediaWiki::API login method is now adjusted to handle this automatically. Thanks to Brent Garber for the heads up and the patch which I used with some minor modifications.