API login isn't possible: WrongPass

Discussion in 'General Discussion and Feedback' started by Scharesoft, Jul 26, 2016.

  1. Scharesoft

    Scharesoft New Member

    We've got a bot for our MediaWiki to insert a lot of articles. But now there is a problem with the bridge. When trying to login, there is an API error:

    The API result was: WrongPass

    It seems there is a problem to login via API when the bridge is active. We're using Wikimate, but also other bots has got the same problem. Each script with API access will have this problem. As soon as the bridge is disabled, the login is possible again.

    This is a small example script to test it, after Wikimate is installed through this small manual:
    PHP:
    <?php
    include 'globals.php';

    $api_url '[BOT URL]';
    $username '[BOT NAME]';
    $password '[BOT PASSWORD]';

    try
    {
        
    $wiki = new Wikimate($api_url);

        
    var_dump($wiki);

        
    // You can also pass the domain name:
        // $wiki->login($username, $password, $domainName)
        
    if ($wiki->login($username$password))
            echo 
    "Success.\n";
        else {
            
    $error $wiki->getError();
            echo 
    "<b>Wikimate error</b>: ".$error['login']."\n";
            exit(
    1);
        }
    }
    catch ( 
    Exception $e )
    {
        echo 
    "<b>Wikimate error</b>: ".$e->getMessage()."\n";
        exit(
    1);
    }

    // create a new page object
    $page $wiki->getPage('Test222');
    // check if the page exists or not
    if ( !$page->exists() ) {
        echo 
    "Page doesn't exist.";
        die();
    }

    var_dump($page);
    // get the page title
    echo $page->getTitle();
    // get the number of sections on the page
    echo $page->getNumSections();
    // get an array of where each section starts and its length
    echo $page->getSectionOffsets();
    A solution for this would be really great! In the moment we have to disable the bridge temporary each time we start the bot.
     
  2. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    @Scharesoft Because API logins is useless for the bridge I can try to disable add-on for API calls
     
    Scharesoft likes this.
  3. Scharesoft

    Scharesoft New Member

    I think this could be an option :) We need the API login only with our bots and so the bridge is not necessary for them.
     
  4. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    Bots can not login using XenForo credentials so I think disabling bridge for the API must be hardcoded.
     
  5. Scharesoft

    Scharesoft New Member

    Ok, then it would be great if you could try to disable the bridge for the API hardcoded. This is definitely better than disable the bridge manually each time the bot runs.
     
  6. Yoskaldyr

    Yoskaldyr Administrator Staff Member

    @Scharesoft I've disabled bridge for API calls, so you can download a latest version of the bridge
     
    Scharesoft likes this.
  7. Scharesoft

    Scharesoft New Member

    Thanks for the update and the great support! It's working :)
     

Share This Page