使用OAuth2登录YouTube时出错

使用Google Client API PHP在YouTube上提交视频时遇到以下问题。

"token": "*****_5pNR0HX3nRi","error_details": "Error refreshing the OAuth2 token,message: '{\n \"error\": \"invalid_grant\",\n \"error_description\": \"Bad Request\"\n}'"

我尝试了几种解决方案,但我的问题尚未解决。我正在使用以下代码:

$this->client = new Google_Client();  
$this->client->setClientId($id);
$this->client->setClientSecret($secret);
$this->client->setaccessType("offline");
$this->client->setapplicationName('Shopper Approved Testimonials');
if ($redirecturl) {
   $this->client->setRedirecturi($redirecturl);
}

$this->youTubeService = new Google_YoutubeService($this->client);
$this->client->refreshToken($this->dbsite->YoutubeEmail); //where $this->dbsite->YoutubeEmail is = $google_token->refresh_token

其中缺少什么,如果有人可以指导,非常感谢!

iCMS 回答:使用OAuth2登录YouTube时出错

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2050895.html

大家都在问