OAuth and Wordpress

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

Hey, @DWorktextile :waving_hand: Can you tell the community more about your goal? It’s not 100% clear what you’re trying to accomplish with OAuth in this context.

  • Have you created an app in a HubSpot developer account?
  • Set up OAuth for your app?
  • Are you trying to connect your app via OAuth?

Thank you.

Jaycee

I need to implement it to remove the apiKey.
We have create an app on our HubSpot developer account.
The main problem is to set up and trying to connect my app via OAuth on our Wordpress.