nguyentientoan / socialauth-net

Automatically exported from code.google.com/p/socialauth-net
0 stars 0 forks source link

Google contacts array is empty #161

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up application as per instructions
2. Generate new Google API key and secret
3. Successfully authenticate with Google
4. Invoke method SocialAuthUser.GetCurrentUser().GetContacts()

What is the expected output? What do you see instead?
Expected: An array of google contacts.
Instead: Emtpy array (0 elements)

What version of the product are you using? On what operating system?
v2.3
Windows 8 x64

Please provide any additional information below.
Authentication is ok, getting profile information works. Running on local 
machine, but with HOST file override to valid domain. The only thing missing is 
contacts, log in is successful. Google Project (with client key and secret) 
does not have a service option for allowing access to Contacts, so I'm assuming 
this is available by default.

The other providers work fine (Twitter, LinkedIn, Yahoo etc) and return 
contacts, it's just Google that doesn't. 

Web.config setting for wrapper:
<add ScopeLevel="CUSTOM" AdditionalScopes="" WrapperName="GoogleWrapper" 
ConsumerKey="key" ConsumerSecret="secret" />

I have to set scopelevel to CUSTOM and AdditionalScopes to empty string. 
Leaving it any other way will cause "Invalid Request Token received" exception:

openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint
=https://www.google.com/accounts/o8/ud&openid.response_nonce=2013-01-21T03:51:44
ZyF_5H8hhsf_71g&openid.return_to=http://filemail.com/socialauth-net/socialauth/v
alidate.sauth&openid.assoc_handle=AMlYA9UzK3wZmjWxL27cOGgdbYcWlyJewhIhxcIG28DE3K
7vq5PhMpYR&openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonc
e,assoc_handle,ns.ext1,ext1.mode,ext1.type.firstname,ext1.value.firstname,ext1.t
ype.lastname,ext1.value.lastname,ext1.type.language,ext1.value.language,ext1.typ
e.email,ext1.value.email&openid.sig=lMq35/LiWo2ZRH9r1ZT4/Nj3uKM&openid.identity=
https://www.google.com/accounts/o8/id?id&openid.claimed_id=https://www.google.co
m/accounts/o8/id?id&openid.ns.ext1=http://openid.net/srv/ax/1.0&openid.ext1.mode
=fetch_response&openid.ext1.type.firstname=http://axschema.org/namePerson/first&
openid.ext1.value.firstname=Andreas&openid.ext1.type.lastname=http://axschema.or
g/namePerson/last&openid.ext1.value.lastname=Vatne&openid.ext1.type.language=htt
p://axschema.org/pref/language&openid.ext1.value.language=no&openid.ext1.type.em
ail=http://axschema.org/contact/email&openid.ext1.value.email=andreas.vatne@gmai
l.com

Any clue? Do you still have to enable Contacts API in Google API, and if so: 
where? It is not an option in the service list (anymore, seems like in previous 
versions it was).

Thanks,
A.

Original issue reported on code.google.com by andreas....@gmail.com on 21 Jan 2013 at 3:55

GoogleCodeExporter commented 8 years ago
Just a comment: I would have expected that ScopeLevel DEFAULT would have been 
enough, without any AdditionalScope declaration, but this throws Invalid 
Request Token. I know my key and secret are correct, without any spaces etc. 

Original comment by andreas....@gmail.com on 21 Jan 2013 at 3:59

GoogleCodeExporter commented 8 years ago
When ScopeLevel is set to custom and additionalScope is blank, SocialAuth 
doesn't pulls in anything except basic authentication. So you definitely need 
Scope=Default to pull contacts.

As regarding invalid token error, it comes ONLY when there is a mismatch 
between token/secret specified in config and what's being obtained from Google.

I hope you're using consumerKey obtained by registering application from 
ManageYourDomains and not the ClientID obtained when a project is registered 
from Google Project API.

Deepak

Original comment by deepak.a...@3pillarglobal.com on 21 Jan 2013 at 5:24

GoogleCodeExporter commented 8 years ago
Is your problem resolved with last comment? You need to have 
scopeLevel="Default" and use consumer key (not client Id) and secret which is 
obtained from https://www.google.com/accounts/ManageDomains

Original comment by deepak.a...@3pillarglobal.com on 18 Feb 2013 at 5:26

GoogleCodeExporter commented 8 years ago
Closing this ticket due to no reply. Feel free to re-open it with details (and 
try 2.4 if you haven't yet)

Original comment by deepak.a...@3pillarglobal.com on 21 Oct 2013 at 10:44

GoogleCodeExporter commented 8 years ago

Original comment by deepak.a...@3pillarglobal.com on 1 Dec 2013 at 3:25