doucheng4094 2015-11-15 12:42
浏览 65
已采纳

传递参数HWIOAuthbundle symfony2

I'm trying to pass a GET parameter from my Facebook and Google login button, that I've set up using HWIOAuthbundle. I've looked at this question: To path the parameter to OAuth facebook login by symfony2/HWIOAuthBundle, however I didn't quite understand how he managed to get it working. He mentions using referer, which I don't anything about - and I don't have enough reputation to post a comment on that question...

I was thinking something like this:

<a href="{{ path('google_login',{'datakey':1}) }}">Link</a>

But how do I retrieve it in my FOSUBUserProvider? I appreciate all help!

  • 写回答

1条回答 默认 最新

  • doucao1066 2015-11-19 18:25
    关注

    I finally managed to get it working. However, I am not sure it is the best way to do it. It's a quick fix until I find a more proper solution.

    When someone enters my website with the datakey variable as a $_GET parameter, I set a cookie with the value. When the user logs in, the FOSUBUserProvider checks whether the datakey cookie is set; if it is, it will do its thing.

    This is the best I can do for now, as I haven't managed to succeed sending parameters through the hwioauthbundle and into my FOSUBUserProvider.

    If someone finds a better solution, let me know!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题