Hybridauth Redirecting to Blank Page

142 Views Asked by At

I am trying to set up Hybridauth 3 Twitter and Google logins:

The problem I'm having is that the page returns blank and gets hung up in "process_sign_up.php". I can't for the life of me figure out how to fix this. I've looked up several threads when searching the topic.. no luck. I've tried adding session_start() to the top.. no luck

process_sign_up.php:

if ($_REQUEST['provider']) {

// Social Login

// the selected provider
$provider_name = $_REQUEST["provider"];

//Include Hybridauth's basic autoloader
include 'hybridauth3/src/autoload.php';

if ($provider_name == "twitter") {

    $config = [
        'callback' => 'https://www.example.com/process_sign_up.php',
        'keys' => [ 'key' => 'keyhere', 'secret' => 'secrethere' ]
    ];

    try {

        $twitter = new Hybridauth\Provider\Twitter($config);

        $twitter->authenticate();

        $accessToken = $twitter->getAccessToken();
        $userProfile = $twitter->getUserProfile();

        print_r($accessToken);
        print_r($userProfile);

    }

It never seems to get past

$twitter->authenticate();

After the code above executes, I am redirected to my callback url with these parameters attached:

?oauth_token=H5IIfwAAbbA6rviAAABaFJ2_bs&oauth_verifier=HATimlasfdsdfLe0sclYB81Lptaufha2

But the page hangs up on the callback url.

What can I do to solve this? Am I missing something obvious?

0

There are 0 best solutions below