小编use*_*035的帖子

HWIOAuthBundle用于webapp的Google登录device_id和device_name

我正在开发一个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
Run Code Online (Sandbox Code Playgroud)

请求详情:

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>
Run Code Online (Sandbox Code Playgroud)

Google文档没有提到这两个参数.我尝试手动发送请求,其中device_id是UUID,device_name设置为"notes".我这次得到的回应是:

Error: invalid_request

Device info can be set only for native apps.
Run Code Online (Sandbox Code Playgroud)

请求详情:

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>
Run Code Online (Sandbox Code Playgroud)

现在,我做错了什么?

symfony fosuserbundle google-oauth hwioauthbundle

13
推荐指数
1
解决办法
8260
查看次数