Page MenuHomePhabricator

Make clientlogin interactive
Open, Needs TriagePublic

Description

action=clientlogin is supposed to be interactive, however our quick&dirty implementation just expects username, password and rememberMe parameters to be asked. If login error of missing params occurs, Pywikibot should interactively ask for them.

Find the clientlogin code in pywikibot/login.py and pywikibot/data/api.py, add a check if login error of missing params occurs and then interactively ask for the missing stuff. https://www.mediawiki.org/wiki/API:Login explains the interactiveness of the login process to the detail.

Also if login error occurs, there should be a check if login is even allowed to avoid T249403

Related Objects

Event Timeline

Dvorapa created this task.Apr 8 2020, 12:43 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptApr 8 2020, 12:43 PM
Dvorapa updated the task description. (Show Details)Apr 8 2020, 12:45 PM
Dvorapa updated the task description. (Show Details)Apr 8 2020, 12:57 PM
Dvorapa updated the task description. (Show Details)
Dvorapa updated the task description. (Show Details)
Pppery added a subscriber: Pppery.Apr 12 2020, 9:23 PM

I note that the API clientlogin handler supports a REDIRECT response. What should happen if pywikibot recieves that response?

Dvorapa added a comment.EditedApr 12 2020, 9:28 PM

I honestly don't know as I haven't found any wiki using this feature, so I could test it. I hope Pywikibot currently breaks with some meaningful error message (it should after last few patches). I would say Pywikibot should just print the url to the user and wait (?) so they can open it in browser and follow the steps. As clientlogin with regular user password is intended for humans, not bots, Pywikibot should expect no bot is using user password, the same as WMF does.

Pppery removed a subscriber: Pppery.Apr 12 2020, 10:30 PM

@Dvorapa: A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor. Given the current short task description I'm removing the good first task tag. Please add details what exactly has to happen where and how for a new contributor, have no "perhaps" left and make this task about one aspect (I don't see how login errors occuring are related to making this interactive), and then add back the good first task project tag. Thanks a lot in advance!

Dvorapa updated the task description. (Show Details)

@Aklapper Sorry, I've had no free time so far this year. I improved the description. "perhaps" seems as a language issue, I use the Czech equivalent "třeba"/"možná" all the time as a general suggestion, how to behave, like "You should". I better removed that.

Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:01 PM

I would like to take up this task but would need some guidance for the same.

How should I add this check of missing params, I mean to which functions changes should be made in order to facilitate the missing params check?

Don't assume that this is a good-first-task

@Xqt so should I first look forward to solving good first tasks?

Xqt added a comment.Sun, Nov 15, 8:11 PM

@Xqt so should I first look forward to solving good first tasks?

I guess yes. This task here is more difficult than a usual good-first-task for the developer as well as the reviewer I think.