Maybe I'm not understanding how the Youtube Data API is supposed to work. But if I have a PHP application that will generate the oauth request and receive the callback (which I have), the data it sends back is not a user's API key.
So I don't know if I am doing this wrong, or what, but their documentation is giving me a headache and I have searched and searched and I don't even know if my process is right here:
Web Server / OAuth Request (php)
require_once 'vendor/autoload.php';
$client = new Google_Client();
$client->setAuthConfig('oauth.json');
$client->setAccessType("offline"); // offline access
$client->setIncludeGrantedScopes(true); // incremental auth
$client->addScope(Google_Service_YouTube::YOUTUBE_READONLY);
$client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php');
$auth_url = $client->createAuthUrl();
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
Client Authorizes my Application
Google sends back (whatever this is)
'code' => string 'BLABLABLABLABLA' (length=89)
'scope' => string 'https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile' (length=224)
Where is the user's API key, how do I get it? Is this not correct, or am I just jumbling stuff up here?