Google OAuth2 - 错误:redirect_uri_mismatch

问题描述

我正在尝试运行此项目 https://github.com/googleapis/python-analytics-data 我在云平台中创建了新的客户端 OAuth 2.0 并且我有 client_secret_code 并且我将 uri http://localhost 添加到客户端 OAuth 设置 但我有这个错误:redirect_uri_mismatch

解决方法

redirect_uri_mismatch

这是一个配置问题。您在 Google Cloud Console 中为项目添加的重定向 uri 必须与您的代码发送的完全匹配。

最简单的解决方案是检查错误消息,它会告诉您缺少的重定向 uri,只需在 Google 开发者控制台中添加即可。

Google OAuth2: How the fix redirect_uri_mismatch error.