我正在尝试从我的基于 Java 的网络应用程序上传到 YouTube,我花了几天时间来了解问题出在哪里以及在哪里,但我无法解决问题,现在我正把头发从头上扯下来。
我在 Google 控制台中注册了我的网络应用,因此我得到了一对客户端 ID 和 key ,并且可以使用我的配置下载 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?
请求中的重定向 URI:http://localhost:8080/Callback 与注册的重定向 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 和 google-api-services-youtubeAnalytics v1-rev35-1.17.0-rc
最佳答案
关于java - 谷歌 OAUTH : The redirect URI in the request did not match a registered redirect URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22595174/