【问题标题】:using oauth in laravel gives Error: redirect_uri_mismatch在 laravel 中使用 oauth 会出现错误:redirect_uri_mismatch
【发布时间】:2019-07-21 14:28:20
【问题描述】:

我想使用 socialite 包将 google oauth 添加到我的 laravel 项目中。我在谷歌开发者控制台中创建了一个带有地址的项目

http://lvh.me

这是本地主机。对于回调 url,我添加了这个:

http://lvh.me:8000/login/google/callback

然后我将路由和函数添加到我的项目和 authController。现在当我点击地址时

http:lvh.me:8000/login/google

它为我返回错误:

错误:redirect_uri_mismatch

请求中的重定向 URI https://lvh.me:8000/login/google/callback 与授权给 OAuth 客户端的重定向 URI 不匹配。更新授权的重定向 URIs

我做错了什么?

【问题讨论】:

    标签: laravel authentication oauth oauth-2.0


    【解决方案1】:

    这意味着您在 OAuth 请求中发送的 redirect_uri 与您在 Google Cloud Console 中注册的不匹配。检查并查看其中任何一个是否错误。它们应该是相同的。

    【讨论】:

      猜你喜欢
      • 2013-01-15
      • 2016-10-09
      • 1970-01-01
      • 2014-02-09
      • 2015-04-03
      • 1970-01-01
      • 2020-11-08
      • 2019-07-14
      • 2021-06-14
      相关资源
      最近更新 更多