Youtube API 3视频上传400错误:redirect_uri_mismatch OAuth2 [英] Youtube API 3 Video Upload 400 Error: redirect_uri_mismatch OAuth2

查看:255
本文介绍了Youtube API 3视频上传400错误:redirect_uri_mismatch OAuth2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下链接中的代码示例,以使用Youtube API将视频上传到Youtube.

I am using the code example in the below link to use the Youtube API to upload videos to Youtube.

https://developers.google.com/youtube/v3/code_samples/php#resumable_uploads

每当我尝试授权访问权限时,我都会得到400. That's an error Error: redirect_uri_mismatch.

I get 400. That's an error Error: redirect_uri_mismatch everytime I try to authorise access.

我已经进行了一百次检查,以确保开发人员控制台中的重定向URI与重定向请求URI完全匹配.所以我很为这个错误感到困惑.

I have rechecked a hundred time to ensure the Redirect URI in the developer console and redirect request URI match exactly. So I am pretty stumped on this error.

错误详细信息

The redirect URI in the request: http://www.example.com/classes/YouTubeVideoUpload.php did not match a registered redirect URI.

请求详细信息

scope=https://www.googleapis.com/auth/youtube
response_type=code
access_type=online
redirect_uri=http://www.example.com/classes/YouTubeVideoUpload.php
pageId=none
approval_prompt=auto
state=463513941
client_id=*************-gajjqgcjt767rfqapprgu5ctdi3qts27.apps.googleusercontent.com

还有其他可能导致它认为不匹配的东西吗?

Is there something else likely to cause it to think there is a mismatch?

推荐答案

此问题是由已设置的API密钥引起的.

The issue was being caused by the API key which had been set.

$client->setAPIKey($API_Key);

一旦删除的脚本按预期执行

Once deleted script executed as expected

Error: redirect_uri_mismatch对于此错误颇具误导性

The Error: redirect_uri_mismatch was quite misleading for this error

这篇关于Youtube API 3视频上传400错误:redirect_uri_mismatch OAuth2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆