我正在开发一个 Symfony2 应用程序。我正在使用 FOSUserBundle 处理身份验证,最近使用本教程将其与 FOSUserBundle 集成:https ://gist.github.com/danvbe/4476697 。
问题是:我可以在 localhost 上使用 google api 登录,一切正常。
但是,当我尝试登录真实服务器时,我得到:
Error: invalid_request
device_id and device_name are required for private IP: http://<server_ip>/login/check-google
请求详情:
response_type=code
scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
redirect_uri=http://<server_ip>/login/check-google
client_id=<my_id>
谷歌文档没有提到这两个参数。我尝试手动发送一个请求,其中 device_id 为 UUID,device_name 设置为“notes”。这次我得到的回应是:
Error: invalid_request
Device info can be set only for native apps.
请求详情:
cookie_policy_enforce=false
response_type=code
device_name=notes
scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile
redirect_uri=http://<server_ip>/login/check-google
device_id=4b3403665fea6
client_id=<my_id>
现在,我做错了什么?