Skip to content

Support login via bot password #35

Description

@lucaswerkmeister

Currently, mwapi.Session supports login with credentials via action=clientlogin, which only supports the user’s real password (and may require an interactive flow, continuing the login in another step). It would be nice to also support bot passwords – by automatically detecting them in login() (username contains “@”), by adding a new method for action=login instead of action=clientlogin, or at least by documenting the following workaround:

lgtoken = session.get(action='query',
                      meta='tokens',
                      type='login')['query']['tokens']['logintoken']
session.post(action='login',
             lgname=bot_username,
             lgpassword=bot_password,
             lgtoken=lgtoken)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions