Question

I would want to implement a user authentication + accesing his/her data in google account. OAuth seems to be the best choice, but openId and google friend connect also seem to confuse me. Here are my requirements :

  1. Ask the user only ONE TIME to grant scope permissions for my app ( as done by facebook apps )

  2. Based on permissions , fetch the user data, and create his/her account for my website. Here I would want to map his UNIQUE GOOGLE ID to UNIQUE MYWEBSITE ID, and store the pair. How can I fetch UNIQUE_GOOGLE_ID ? eg. for facebook it is profile id : so I map 111100xxxx -> MY_WEBSITE_ACCOUNT_ID

What is the numeric unique id for google accounts apart from email ?

  1. When the user logins the second time, he should not be asked for permission, and logged in using his UNIQUE_GOOGLE_ID store in step 2.

Can OAuth do all this, primarily step #1 , asking for permissions only once, unless revoked in google account settings.

Was it helpful?

Solution

oauth is the way to go since it is now a sort of industry standard and works similar to facebook's implementation of oauth, take a look:

http://code.google.com/apis/accounts/docs/OAuth2.html 

especially "OAuth 2.0 for client-side web applications" will be the closest equivalent of "facebook connect":

http://code.google.com/apis/accounts/docs/OAuth2.html#CS 

hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top