简体   繁体   中英

Adding a Google+ registration method to an application with an existing user database

Would anyone be kind enough to help me with the logic of adding Google registration to my app. I understand the technical side (retrieving the data etc.) but I'm a bit stumped as to how to actually save that information. I currently have an email/password system for registration and the user table in my database contains the name, email, password and avatar of the user.

What would be the best way to save a user with the data retrieved from G+? Would I have a separate table? Would I add it to the the same table, perhaps with a generated prefix for the password? If I did that how would I prevent login from the regular email/password form for that user?

Any insight into how to do this would be much appreciated.

You would be having a unique id for each user.What you can do is create a separate table for g+ data.Add a column of g_username in current table When user has authenticated add information to your g+ table, with unique id as his g_username.

When user will try to login using g+ you can lookup that g+ id and if user uses uses his password you can check g+ column value for empty or null.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM