相关疑难解决方法(0)

Google OAUTH:请求中的重定向URI与注册的重定向URI不匹配

我正试图从我的基于Java的网络应用程序上传到YouTube,我花了几天时间来了解问题的原因和地点,我无法得到它,因为现在我正在把头发拉出来.

我在Google控制台中注册了我的网络应用程序,因此我获得了一对客户端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/"]
    }
}
Run Code Online (Sandbox Code Playgroud)

我如何从Google获取默认网址?

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-rcgoogle-api-services-youtubeAnalytics v1-rev35-1.17.0-rc

java youtube-api google-oauth youtube-data-api google-oauth-java-client

49
推荐指数
3
解决办法
11万
查看次数