dongxia4880 2015-03-23 16:24
浏览 11
已采纳

如果使用facebook进行身份验证,则在USER表中存储空白密码

I am designing an application that would accept new users through signup form, or login using facebook.

When user signs up, I'd create a user record and store the encrypted password (hash) in the USER table. If the user signs up through FB, I still want to create the user record.

But how should I handle the password column since I will not be exposed to their FB password. Or should I separate userid/login/password from the USER table and keep it in a separate table and FB users will not have a record in this new table.

  • 写回答

1条回答 默认 最新

  • donglian4770 2015-03-23 17:15
    关注

    Either of those will work fine- you probably just want to keep a record in your User table of what authentication provider this user prefers and use that as a guide to how you log them in.

    There are advantages to storing log-in details separately from user accounts, but they are going to be fairly closely associated anyway and there's no harm in storing the log-in with the user account details in many cases. Keeping separate log-in records would make it easier to record when a user signed-in and with which credentials, catch when they try to change their password to something they have used in the past and so on, but whether you want that level of auditing for your application is entirely down to you.

    There is no risk in having a blank password in the user table in itself, as long as you can ensure there is no route by which someone could try and force the system to log a Facebook-authenticated user in using your standard log-in process. Having an indication of what log-in type a user favours and ensuring that any log-in attempt against a blank password automatically fails should be sufficient to avoid this as a problem.

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

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测