我正在尝试从我的基于 Java 的网络应用程序上传到 YouTube,我花了几天时间来了解问题出在哪里以及问题出在哪里,但我无法得到它,现在我正把头发从头上扯下来。
我在 Google Console 中注册了我的网络应用程序,因此我得到了一对客户端 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/"]
}
}
我怎么可能从 Google 获得默认 URL?
The redirect URI in the request: http://localhost:8080/Callback did not match a registered redirect URI
它总是给我默认的http://localhost:8080/CallbackURL 而不是我的。
IDE 控制台向我显示:
Please open the following address in your browser:
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
Attempting to open that address in the default browser now...
我正在使用最新版本的依赖项: google-api-services-youtube v3-rev99-1.17.0-rc和google-api-services-youtubeAnalytics v1-rev35-1.17.0-rc