Phalcon Framework 3.3.1

Abraham\TwitterOAuth\TwitterOAuthException: {"errors":[{"code":32,"message":"Could not authenticate you."}]}

/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/TwitterOAuth.php (137)
#0Abraham\TwitterOAuth\TwitterOAuth->oauth(oauth/request_token, Array([oauth_callback] => http://dada-data.net/ro/tweet/signin))
/home/block-dada/dada-website/apps/frontend/Controllers/TweetController.php (25)
<?php
 
namespace Akufen\Frontend\Controllers;
 
use Akufen\Frontend\Helpers\Pages;
 
class TweetController extends AbstractHacktions
{
    /**
     * Dada Tweet
     */
    public function indexAction()
    {
        // Request an oauth token for authentication
        $config = $this->di->getConfig();
        $twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
            $config->application->twitter->consumerKey,
            $config->application->twitter->consumerSecret
        );
 
        $twitter->setTimeouts(10, 15);
        $twitterTokens = $twitter->oauth(
            'oauth/request_token',
            array('oauth_callback' => 'http://'.$_SERVER['HTTP_HOST'].'/'.$this->language.'/tweet/signin')
        );
 
        // Store the twitter callback
        $this->session->set('twitterCallback', $this->request->get('_url').'?skip=true');
 
        // Store the token for future validation
        if(!$this->session->has('twitterToken')) {
            $this->session->set('twitterToken', $twitterTokens['oauth_token']);
            $this->session->set('twitterTokenSecret', $twitterTokens['oauth_token_secret']);
        }
 
        // Store temporary tokens for view rendering
        $this->view->twitterTokens = $twitterTokens;
 
        // Build seo meta tags
        Pages::buildSeo($this->node, '/img/meta/fb/tweet.jpg');
 
        // Handle the rest of the hacktion
        $this->handleHacktion('tweet');
    }
 
    /**
     * Twitter Signin Action
     */
    public function twitterSigninAction()
    {
        // Retrieve the twitter params
        $params = $this->request->get();
 
        // Validate the access token with the verifier
        try {
            $config = $this->di->getConfig();
            $twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
                $config->application->twitter->consumerKey,
                $config->application->twitter->consumerSecret,
                $this->session->get('twitterToken'),
                $this->session->get('twitterSecret')
            );
 
            $twitter->setTimeouts(10, 15);
            $response = $twitter->oauth(
                'oauth/access_token',
                array(
                    'oauth_verifier' => $params['oauth_verifier'],
                    'oauth_token' => $params['oauth_token']
                )
            );
        } catch (\Exception $e) {
            return $this->dispatcher->forward(array(
                'controller' => 'error',
                'action' => 'show404'
            ));
        }
 
        // Store twitter connect information
        $this->session->set('twitterId', $response['user_id']);
        $this->session->set('twitterUsername', $response['screen_name']);
        $this->session->set('twitterToken', $response['oauth_token']);
        $this->session->set('twitterSecret', $response['oauth_token_secret']);
 
        // Redirect the user to twitter hacktions
        return $this->response->redirect($this->session->get('twitterCallback'));
    }
 
    /**
     * Twitter Intent Action
     */
    public function tweetIntentAction()
    {
        // Request valid parameters
        if(!$this->session->has('twitterToken') || !$this->request->isAjax() || !$this->request->hasPost('message'))
            return $this->dispatcher->forward(array(
                'controller' => 'error',
                'action' => 'show404'
            ));
 
        // Disable view rendering
        $this->view->disable();
 
        // Handle new twitter request
        $config = $this->di->getConfig();
        $twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
            $config->application->twitter->consumerKey,
            $config->application->twitter->consumerSecret,
            $this->session->get('twitterToken'),
            $this->session->get('twitterSecret')
        );
        $twitter->setTimeouts(10, 15);
 
        // Store message locally
        $message = $this->request->getPost('message');
 
        // Attempt to find #dadadata
        if(!preg_match('/\#dadadata/mi', $message)) {
            $message = trim($message).' #dadadata';
        }
 
        // Post the message for the user
        $twitter->post('statuses/update', array(
            'status' => $message
        ));
    }
}
#1Akufen\Frontend\Controllers\TweetController->indexAction(ro, tweet)
#2Phalcon\Dispatcher->callActionMethod(Object(Akufen\Frontend\Controllers\TweetController), indexAction, Array([0] => ro, [1] => tweet))
#3Phalcon\Dispatcher->dispatch()
#4Phalcon\Mvc\Application->handle()
/home/block-dada/dada-website/public/index.php (84)
<?php
 
try {
 
    // Create dependency injector
    $di = new \Phalcon\DI\FactoryDefault();
    $di->set('config', function() {
        return include __DIR__ . '/../config.php';
    });
 
    // Retrieve instance of configuration
    $config = $di->getConfig();
 
    // Set development flags
    if(!$config->application->production) {
        // Report all error
        error_reporting(E_ALL);
 
        // Create a new debug listener
        $debug = new \Phalcon\Debug();
        $debug->listen();
    }
 
    // Url service configuration
    $di->set('url', function() use($config) {
        $url = new \Phalcon\Mvc\Url();
        $url->setBaseUri($config->application->baseUri);
        return $url;
    });
 
    // Session service configuration
    $di->set('session', function() {
        $session = new \Phalcon\Session\Adapter\Files();
        $session->start();
        return $session;
    }, true);
 
    // Configure router
    $di->set('router', function() use($config) {
        $router = new \Phalcon\Mvc\Router();
        $router->setDefaultModule($config->application->defaultModule);
        $router->removeExtraSlashes(true);
 
        // Iterate and mount router groups from the configuration
        foreach($config->application->routers as $info) {
            require_once $info->path;
            $group = new $info->className;
            $router->mount($group);
        }
 
        return $router;
    }, true);
 
    // Modules configuration
    $routerAdapater = array();
    $di->set('modules', function() use($config) {
        $modules = array();
        foreach($config->modules->toArray() as $module) {
            // Find out if the module is a composer package
            if(substr($module, 0, 1) == '/') {
                $modulePath = '..' . $module;
            } else $modulePath = '../vendor/' . $module . '/src';
 
            // Find the module name
            $segments = explode('/', $module);
            $moduleName = end($segments);
 
            // Build the module configuration array
            $modules[$moduleName] = array(
                'className' => 'Akufen\\' . ucfirst($moduleName). '\\Module',
                'path' => $modulePath . '/Module.php'
            );
        }
 
        return $modules;
    });
 
    // Application configuration
    $application = new \Phalcon\Mvc\Application();
    $application->setDI($di);
    $application->registerModules($di->getModules());
 
    // Handle the request
    echo $application->handle()->getContent();
 
} catch (Phalcon\Exception $e) {
    echo $e->getMessage();
} catch (PDOException $e) {
    echo $e->getMessage();
}
KeyValue
_url/ro/tweet
KeyValue
REDIRECT_HTTPSon
REDIRECT_SSL_TLS_SNIdada-data.net
REDIRECT_STATUS200
HTTPSon
SSL_TLS_SNIdada-data.net
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT_ENCODINGgzip, br, zstd, deflate
HTTP_HOSTdada-data.net
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE<address>Apache/2.4.10 (Debian) Server at dada-data.net Port 443</address>\n
SERVER_SOFTWAREApache/2.4.10 (Debian)
SERVER_NAMEdada-data.net
SERVER_ADDR143.198.45.49
SERVER_PORT443
REMOTE_ADDR3.138.126.51
DOCUMENT_ROOT/home/block-dada/dada-website/public
REQUEST_SCHEMEhttps
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT/home/block-dada/dada-website/public
SERVER_ADMINsupportt@akufen.ca
SCRIPT_FILENAME/home/block-dada/dada-website/public/index.php
REMOTE_PORT23594
REDIRECT_QUERY_STRING_url=/ro/tweet
REDIRECT_URL/ro/tweet
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
QUERY_STRING_url=/ro/tweet
REQUEST_URI/ro/tweet
SCRIPT_NAME/index.php
PHP_SELF/index.php
REQUEST_TIME_FLOAT1732183694.005
REQUEST_TIME1732183694
#Path
0/home/block-dada/dada-website/public/index.php
1/home/block-dada/dada-website/config.php
2/home/block-dada/dada-website/apps/frontend/Router.php
3/home/block-dada/dada-website/apps/contest/Router.php
4/home/block-dada/dada-website/vendor/akufen/backend/src/Router.php
5/home/block-dada/dada-website/apps/frontend/Module.php
6/home/block-dada/dada-website/vendor/akufen/backend/src/Services/Translations.php
7/home/block-dada/dada-website/vendor/akufen/backend/src/Services/Dispatcher.php
8/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Entities.php
9/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Entities.php
10/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Base.php
11/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Groups.php
12/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Groups.php
13/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Nodes.php
14/home/block-dada/dada-website/vendor/akufen/backend/src/Models/Nodes.php
15/home/block-dada/dada-website/vendor/akufen/backend/src/Models/StdBase.php
16/home/block-dada/dada-website/vendor/akufen/backend/src/Models/NodeInterface.php
17/home/block-dada/dada-website/vendor/akufen/backend/src/Helpers/Strings.php
18/home/block-dada/dada-website/apps/frontend/Controllers/PagesController.php
19/home/block-dada/dada-website/apps/frontend/Controllers/AbstractHacktions.php
20/home/block-dada/dada-website/apps/frontend/Controllers/ControllerBase.php
21/home/block-dada/dada-website/vendor/akufen/backend/src/Controllers/FrontendController.php
22/home/block-dada/dada-website/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php
23/home/block-dada/dada-website/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
24/home/block-dada/dada-website/apps/frontend/Controllers/TweetController.php
25/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/TwitterOAuth.php
26/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Config.php
27/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Response.php
28/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/HmacSha1.php
29/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/SignatureMethod.php
30/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Consumer.php
31/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Request.php
32/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Util.php
33/home/block-dada/dada-website/vendor/abraham/twitteroauth/src/TwitterOAuthException.php
Memory
Usage1048576