PBB_login() suggestions

Issue #102 resolved
Egon Willighagen created an issue

Hi Sebastian,

on the #wikidata channel on irc.freenode.net where I was getting support for logging in on a new account (I had lost my password #idiotMe), I got these comments on the PBB code:

[26/08/16 14:08] <Alphos> egonw you probably shouldn't be using clientlogin for a bot ; use login instead
[26/08/16 14:09] <egonw> Alphos: interesting point! looking into it...
[26/08/16 14:09] <Alphos> then you'll have to check if ['login']['result'] === 'Success', or better yet if ['login']['lgusername'] == user
[26/08/16 14:10] <Alphos> egonw https://www.mediawiki.org/wiki/API:Login
[26/08/16 14:10] <egonw> btw, I will pass this info along to the PBB team
[26/08/16 14:10] <Alphos> please do
[26/08/16 14:11] <Alphos> clientlogin is for alternate clients displaying content to users ;)

I could trace down the "clientlogin" to this code line:

https://bitbucket.org/sulab/wikidatabots/src/890649b1c2fbb5c0b6d2d826ed8879ffff683082/ProteinBoxBot_Core/PBB_login.py?at=master&fileviewer=file-view-default#PBB_login.py-55

I'm passing these along, hoping you can have a look at it and decide what to do.

Comments (6)

  1. Sebastian Burgstaller

    Thanks for reporting, I changed that to this new method a few days ago (as you can see from my commit 57c0a10), as @putmantime was having some login issues with his web client. But apparently, I did that without looking into the matter close enough. So I will now revert back to our original login procedure/implement both.

    -sebastian

  2. Sebastian Burgstaller

    As a side note, the current login procedure works with bots flawlessly and the Wikidata project API doc needs a strong improvement.

  3. Sebastian Burgstaller

    well, following the suggestions from IRC user Alphos, I get a warning if I use our bot account, so his advice is not consistent. Anyway, will just offer both methods, should one deprecate, just set the flag for the other one.

  4. Sebastian Burgstaller

    this has been resolved, implemented both login methods, users can just proved a user_clientlogin=True flag in case they want to use clientlogin.

    Nevertheless, logging in with a bot account and the standard method produces a warning.

  5. Log in to comment