I am new to google oauth
and openid
connect,lets say i need service account where users store videos in my youtube channel,i created service as given in docs.but i dont know how to get access token lets say my code like this
$param = $this->getParameter('kernel.root_dir').'/xxxx.json';
$client = new \Google_Client();
$client->setClientId('xxxxxxxx');
$client->setScopes('https://www.googleapis.com/auth/youtube');
$client->setRedirectUri('http://localhost:8000/youtube/1/token');
putenv('GOOGLE_APPLICATION_CREDENTIALS='.$param.'');
$authurl = $client->createAuthUrl();
$youtube = new \Google_Service_YouTube($client);
file_get_contents($authurl);
when i run file_get_contents($authurl)
am getting 401 error
, what mistake i made here ?