Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
here I need a logic. I'm building a shopping cart, where there is an user table to store user info. Order table is joined with user table to get info of user by userid. Users are registering into my site by email, pwd and other infos and the data stored to usertable.

Now, there is a requirement to authenticate user by google account, so that user can log in via google account. Means there will not be any registration required to our site. User will come, login via google, and shop.

Now my question is, should i store users data to my user table when they first time login by google. If I don't do that, then after their order how can I do the joining with usertable?

So, I just need the correct way how practical applications do this.

What I have tried:

I need the logic here, not any code.
Posted
Updated 6-Aug-17 20:24pm
Comments
F-ES Sitecore 7-Aug-17 6:10am    
Usually you'll extend your User table to allow for the ID of the external security provider (google+ in your case). So you'll still have a user as normal with a userid, but for people who have signed in using g+ they will have the provider id rather than a username.

However you might want to design things in a way that allows people to link other accounts (facebook etc), possibly link multiple accounts, and also have both mechanisms...ie they can have a username on your site as well as the ability to link other accounts.
souvikcode 10-Aug-17 0:16am    
Thanks. So for first time login I'll insert user data to usertable from google plus, right?
souvikcode 7-Aug-17 7:43am    
Thanks. So for first time login I'll insert user data to usertable from google plus, right?
Karthik_Mahalingam 9-Aug-17 23:19pm    
Always use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.
souvikcode 10-Aug-17 0:16am    
Thanks, I post that by mistake. I'm correcting myself.

1 solution

Microsoft already has Google, Facebook, Twitter, & Microsoft user identify Authentication for ASP.NET Webforms & MVC built in - they have done all the heaving lifting for you!

You can read more about it here: Creating ASP.NET Web Projects in Visual Studio 2013/15/17 | Microsoft Docs[^]
 
Share this answer
 
Comments
souvikcode 7-Aug-17 5:17am    
Thanks. The link is very good. But I wanted to know how to achieve the above approach. Should I save user data to usertable or not. I didn't ask how to integrate with google plus. I can do that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900