API:Login

Login gets several tokens that are needed by the server to recognize logged-in user. In every call to api.php, the cookie set by this request must be passed.

Note: In this and other examples, all parameters are passed in a GET request just for the sake of simplicity. In your application, make sure all large and/or security sensitive parameters are given as part of the POST request. Request: api.php ? action=login & lgname=Yurik & lgpassword=12345 [& lgdomain=wikipedia.org] Result: api: login: result: Success        Other values: NoName, Illegal, WrongPluginPass, NotExists, WrongPass, EmptyPass lgtoken: 123ABC        Also returned as a cookie (e.g. enwikiToken) lgusername: Yurik      Normalized lgname,  also returned as a cookie (e.g. enwikiUserName) lguserid: 12345        Also returned as a cookie (e.g. enwikiUserID)


 * Example
 * http://en.wikipedia.org/w/api.php?action=login&lgname=user&lgpassword=password


 * Important
 * For security reasons, a throttle has been implemented for this method. A failed log-in attempt will require that you either authenticate through the standard Special:Userlogin or wait 60 seconds before you can attempt to log-in through this module again. This throttle is only enabled on servers that support memcaching.