问题描述
我想使用socialite软件包将google oauth添加到我的laravel项目中.我在Google开发人员控制台中创建了一个地址为
i want to add google oauth to my laravel project using socialite package. i create a project in google developer console with address
是本地主机.对于回调URL,我添加以下代码:
which is localhost. and for callback url i add this:
,我将路由和功能添加到了我的项目和authController中.现在当我点击地址
and i added the routes and functions to my project and authController. now when i hit the address
它为我返回了错误:
请求中的重定向URI, https://lvh.me:8000/login/google/callback ,与为OAuth客户端授权的不匹配.要更新授权的重定向URI
The redirect URI in the request, https://lvh.me:8000/login/google/callback, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs
我在做什么错了?
推荐答案
这意味着您在OAuth请求中发送的 redirect_uri
与您在Google Cloud Console中注册的请求不匹配.检查并查看它们中的任何一个是否错误.它们应该相同.
This means that the redirect_uri
you sent in the OAuth request doesn't match the one you have registered in the Google Cloud Console. Check and see whether either of them are wrong. They should be the same.
这篇关于在laravel中使用oauth会给出错误:redirect_uri_mismatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!