Page MenuHomePhabricator

Unable to use bot password to login through the login API
Closed, InvalidPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Create a bot password using the form in Special:BotPasswords
  • Log out from your user account (you probably need to be an anonymous user to be able to log in)
  • Get a login token using this API request
  • Go to Special:ApiSandbox
  • Select the login action in the main section.
  • Go to the now available action=login section and fill the following inputs:
    • lgname: Username@BotName as provided by Special:BotPasswords
    • lgpassword: The password provided by Special:BotPassword
    • lgtoken: The token obtained with the previous api query

What happens?:
{"login":{"result":"Failed","reason":"Unable to continue login. Your session most likely timed out."}}

What should have happened instead?:
The result should be successful.

Event Timeline

Aklapper changed the task status from Open to Stalled.Aug 20 2021, 6:32 AM

Hi @Agabi10, thanks for taking the time to report this!

Create a bot password

How and where?

Get a login token

How and where?

Please elaborate on the steps to reproduce, including links, so there is no room left for interpretation. Thanks!

Agabi10 changed the task status from Stalled to Open.Aug 20 2021, 9:32 AM
Agabi10 updated the task description. (Show Details)

@Aklapper I added the missing info to the description and unstalled the task. Let me know if there is something more missing.

How do you create the login request exactly?

I expected filling the API Sandbox form to be quite straightforward, but I described those steps regardless now.

I ran into this error, is there any fix known for this yet?

Tgr subscribed.

Works for me. I'd guess you are either dropping the session or not properly decoding the login token.

Yeah, looked like I was not saving the cookie properly. Found my answer on the discussion page of API:Login, though.

FWIW OAuth 2.0 owner-only consumers are a better alternative in almost any situation.