开发者

connecting app account with facebook and twitter account

So I have an app account in which it can login using facebook/twitter or as well using the app account it self (username/email and password). Sometimes in an app I see they allow to connect the app account with twitter and facebook account, how do they a开发者_Go百科ctually make these connections? What I am confused is that if I have a User object (stored in the database) then what do I need to store additionally in that User class to represent the connection to a user facebook twitter and facebook account? Can someone give me an insight to this?


Typically all you'd store would be the facebook user id and the twitter user id. When someone wants to connect an account (say Facebook) you'd ask them to log into their app account, then log into their facebook account. You'd then save their facebook user id into the appropriate field in your User object. Later on they can then log in with their facebook account and you can look up the right User using the facebook user id field. Twitter would work the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜