【问题标题】:Error: redirect_uri_mismatch message on Google oAuth?错误:Google oAuth 上的 redirect_uri_mismatch 消息?
【发布时间】:2021-07-20 16:00:55
【问题描述】:

我将应用部署到生产环境,但收到一条错误消息

Erreur 400 : redirect_uri_mismatch The redirect URI in the request, http://codesnippets.azurewebsites.net/auth/google/callback, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs.

但是,我将链接添加到 URI 以及链接 http://localhost:3000/auth/google/callback。我对网站http://www.mywebsite.com/auth/google/callback 做了同样的事情,但是当我尝试添加它时,我收到一条消息,说app is in productionURL should be https?

【问题讨论】:

  • 请包含完整的错误。它到底在说什么网址
  • @DaImTo 我添加了完整的消息

标签: google-oauth google-developers-console


【解决方案1】:

Google 开发者控制台中的重定向 URI 必须与您的应用程序从中调用的重定向 URI 完全匹配。

修复它的最简单方法是复制错误消息提供给您的确切网址。如果它的 https 你需要 https 如果它有一个 prot 你需要一个端口 如果有一个斜杠你也必须包含它。

在你的情况下,你应该添加

http://codesnippets.azurewebsites.net/auth/google/callback

本视频将带您了解它。 Google OAuth2: How the fix redirect_uri_mismatch error.

我能够将它添加到 Web 客户端,而没有与它不是 https 相关的问题。

【讨论】:

  • 当我尝试添加 http://codesnippets.azurewebsites.net/auth/google/callback 时,我收到一条消息说 URL should be https
  • 检查更新我能够毫无问题地添加它我没有收到任何与它是 http 相关的消息。
  • 我不知道为什么我不能添加它在我身边
  • 如果您想添加 http 重定向 uri,您需要将您的应用程序重新置于测试模式。您的应用已发布到生产环境中,您无法在其中使用 http。
猜你喜欢
  • 1970-01-01
  • 2014-02-09
  • 2015-04-03
  • 2020-11-08
  • 2019-07-14
  • 2021-06-14
  • 1970-01-01
  • 2012-07-14
相关资源
最近更新 更多