I have created a class that authorises a vb.net app to access Google Fusion Tables using Oauth2. It opens a web browser in a form if needed, encrypts and stores the refresh token, and it works well. I can access the fusion tables data.
However, I would also like to access Contacts. I have requested access to Contacts from the user.
I can retrieve the AccessToken that works for fusion tables and have tried different techniques to get things working on contacts, but no luck. I keep getting a 401-unauthorised error. But I can get Contacts working if I use clientlogin.
Any help would be much appreciated.
My latest try:
Dim rs As New RequestSettings("App Name", p.AccessToken) 'String retrieved from class
Dim cr As New ContactsRequest(rs)
Dim q As New FeedQuery
q.Uri = New Uri("http://www.google.com/m8/feeds/contacts/<EMAIL>/full/<IDCODE>")
Dim c As New Contact
c = cr.Retrieve(Of Contact)(q)
Thank you to Claudio Cherubino for the suggestion. I was actually already using that scope. Thankfully, I have now, finally, found the answer.
I was literally missing a single letter:
… is wrong, as the scope I requested was indeed:
So the Uri needed to match, with httpS. I added the ‘s’ and it works. Correct code below:
Many thanks for this post for the answer:
http://www.geoffmcqueen.com/2010/03/14/token-invalid-authsub-token-has-wrong-scope-oauth-google-problem