pownraj-anubavam / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Using Consumer Credentials do not work #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use oauth_consumer_key and oauth_consumer_secret with the authClass set to 
apiOAuth
2. Attempt to make a API call

First you will receive errors about missing methods.
  apiHttpRequest::getMethod() does not exist
  apiHttpRequest::getHeaders() does not exist
  apiHttpRequest::setHeaders() does not exist
I believe all of these are actually names
  apiHttpRequest::getRequestMethod()
  apiHttpRequest::getRequestHeaders()
  apiHttpRequest::setRequestHeaders()

After I fix that I still receive

apiServiceException: Error calling GET                               
  https://www.googleapis.com/calendar/v3/users/me/calendarList:        
  (401) Login Required                                                 
  (in lib/vendor/GoogleApi/io/apiREST.php on line 86)  

What is the expected output? What do you see instead?

Output from the API

What version of the product are you using? On what operating system?

r373 of trunk

Please provide any additional information below.

Original issue reported on code.google.com by stephen.ostrow on 2 Mar 2012 at 3:28

GoogleCodeExporter commented 9 years ago
Hey Stephen, are you using the latest version of the client library?
The latest version is available here:
http://code.google.com/p/google-api-php-client/downloads/list

Original comment by chirags@google.com on 4 Mar 2012 at 10:46

GoogleCodeExporter commented 9 years ago
Ah, this is due to support for OAuth 1.0 being removed from the client library.

You will want to switch to using OAuth 2.0.  We have prepared a sample 
application that uses the calendar api for authenticated data (via OAuth 2.0) 
here:
http://code.google.com/p/google-api-php-client/source/browse/trunk/examples/cale
ndar/simple.php

Original comment by chirags@google.com on 6 Apr 2012 at 12:07