using oauth in laravel gives Error: redirect_uri_mismatch

耗尽温柔 提交于 2020-07-09 20:58:08

问题


i want to add google oauth to my laravel project using socialite package. i create a project in google developer console with address

http://lvh.me

which is localhost. and for callback url i add this:

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

and i added the routes and functions to my project and authController. now when i hit the address

http:lvh.me:8000/login/google

it returns for me the error:

Error: redirect_uri_mismatch

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

what am i doing wrong?


回答1:


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.



来源:https://stackoverflow.com/questions/54912724/using-oauth-in-laravel-gives-error-redirect-uri-mismatch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!