Hi,
I need to implement the OAuth on a wordpress website.
I have the differents elements like Client_id and Secret_Id. But each time I Do a call to create the OAuth connetion my Wordpress site crash.
<?php
require_once __DIR__.'/vendor/autoload.php';
use SevenShores\Hubspot\Resources\OAuth2;
use SevenShores\Hubspot\Http\Client;
define("CLIENT_ID", 'CLIENT_ID');
define("CLIENT_SECRET", 'CLIENT_SECRET');
define("REDIRECT_URI", 'REDIRECT_URI');
$myClient = new Client(['key' => CLIENT_SECRET]);
$myOAuth = new OAuth2($myClient);
if (!isset($_GET['code'])) {
$authorizeLink = $myOAuth->getAuthUrl(CLIENT_ID, REDIRECT_URI, $scope);
echo "<a href='$authorizeLink'>Click to Authorize</a><BR>";
exit;
}
?>
I have done this code but It crash at the use and at require_once