How to uniquely identify someone in oAuth

I am currently creating a web app using Google oAuth. I was wondering how I can uniquely identify the authenticated user, so I don't accidentally add duplicates.

+2


a source to share


4 answers


The best way to do this is to use OpenID with the oAuth extension (aka hybrid).



+1


a source


Does Google give other unique parameters like username or user ID?



For example, Twitter and Facebook give you a username and a unique URL that identifies the user's profile picture. If you save these settings on the server side, you can define the user the next time they appear on your site.

+2


a source


I am currently only using OAuth and I am requesting https://www.googleapis.com/auth/userinfo#email as described in http://sites.google.com/site/oauthgoog/Home/emaildisplayscope to get the email address of the authenticated user. I use an email address to uniquely identify the user. That should be good enough for now.

Edited:

According to a recent comment by a google developer (https://groups.google.com/group/oauth2-dev/browse_thread/thread/cf5c137f872f9932) they are currently working on this issue, but for something off the shelf you have to use OpenID authentication ...

0


a source


You have to save somewhere the user user_id you have for your users on your site, along with the corresponding access_token and access_token_secret.

Then you can query that table (or wherever you store this information) with user_id and get the correct tokens

Hello

-1


a source







All Articles