我正试图从我的 Java 网络应用程序上传到 YouTube,我花了几天的时间来了解问题是什么,在哪里,我不能得到它,因为现在我把我的头发从我的头上。
我注册了我的网络应用在谷歌控制台,所以我得到了一对客户端 ID 和秘密,并有可能下载 JSON 类型的文件与我的配置。
配置如下:
{
"web":{
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"client_secret":"***",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"client_email":"***",
"redirect_uris":["http://localhost:8080/WEBAPP/youtube-callback.html","http://www.WEBAPP.md/youtube-callback.html"],
"client_x509_cert_url":"***",
"client_id":"***",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"javascript_origins":["http://www.WEBAPP.md/"]
}
}
我怎么可能从谷歌得到默认的网址?
The redirect URI in the request: http://localhost:8080/Callback did not match a registered redirect URI
它总是给我默认的 http://localhost:8080/Callback URL,而不是我的。
IDE 控制台显示:
请在浏览器中打开下列地址:
Https://accounts.google.com/o/oauth2/auth?client_id=***&redirect_uri=http://localhost:8080/callback&response_type=code&scope=https://www.googleapis.com/auth/youtube.upload
现在尝试在默认浏览器中打开该地址...
我正在使用依赖项的最后一个版本: Google-api-services-youtube v3-Rev99-1.17.0-rc 和 < em > google-api-services-youtubeAnalytics v1-rev35-1.17.0-rc