dongmie3526 2014-07-12 05:54
浏览 92
已采纳

Facebook ID登录和注册不一致

I've been working on a website that allows for users to register with their Facebook accounts, using their FB emails to register. Upon registration, their email and Facebook ID are stored in my database. Users could also register with our form with an email and password. Users have the ability to change their email addresses, but this posed as a problem for Facebook login, since if a FB user changed their email on their account on my website, their facebook would no longer be connected to their account.

I solved this by making Facebook Login use the Facebook ID instead of the email of the user, so Facebook-registered users would be able to change their emails. However, when I made this change, some of the facebook ID's no longer worked. Some users who tried logging in with facebook were met with an error telling them that their email was already in use, meaning that the ID of the facebook account and the ID in my database didn't match, so my website's response was to try registering the user.

Does facebook change the ID or ID format from time to time? I checked the database versus the ID facebook was giving me and they were completely different.

  • 写回答

1条回答 默认 最新

  • dqmnueuu459279 2014-07-12 06:40
    关注

    You can find an alternative way to this kinda problem,

    add a field called alt_fb_email

    store the fb email here.

    So the login condition matches like as follows

    If the [changed email (OR condition) alt_fb_email] and [password] in table are same then login

    Will this suits you?

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

报告相同问题?

悬赏问题

  • ¥15 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理