2

How to request a OAuth 2.0 access token by Google GData API? Does this API support OAuth 2.0? It is seems OAuth 1.x API only in the spec.

I already get the access token. Now, I would like to send the OAuth2 request by GData API. The error msg is: Error while validating OAuth2 request.

Does following parameter a correct Oauth2 request header: Header("Authorization", "Bearer " + accessToken) ??

Ack
  • 2,233
  • 3
  • 16
  • 17

1 Answers1

0

You first use any method you prefer (e.g. using the google-api-java-client or directly using REST) to get an OAuth 2 access token, then you set up your GData client library service with this access token and use it to call some API.

Community
  • 1
  • 1
Jan Gerlinger
  • 7,361
  • 1
  • 44
  • 52
  • Thanks. I already get the access token. Now, I would like to send the OAuth2 request by GData API. The error msg is: Error while validating OAuth2 request. Does following parameter a correct Oauth2 request header: Header("Authorization", "Bearer " + accessToken) ?? – Ack Oct 09 '12 at 10:04
  • Please post a question with detailed information about your specific problem (including your source code and your authorizations steps, scope etc.) – Jan Gerlinger Oct 09 '12 at 10:12
  • my oauth2.0 resource server is powered by WSO2 ESB oauth mediator, the source code: http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.2AF/components/identity/org.wso2.carbon.identity.oauth.mediator/4.0.1/src/main/java/org/wso2/carbon/identity/oauth/mediator/ . And I use HttpURLConnection to send my request header and token to resource server. – Ack Oct 09 '12 at 10:20
  • What does this have to do with Google's GData API? – Jan Gerlinger Oct 09 '12 at 10:52
  • I got a sample code for OAuth 1.0. The sample code uses GData API to process the requests and responses of OAuth 1.0. But GData may not support OAuth 2.0 anymore. So I am trying to make a bearer header to get a resource from ESB OAuth 2.0 proxy. – Ack Oct 09 '12 at 12:02
  • What exactly are you trying to achieve by using the GData API? – Jan Gerlinger Oct 09 '12 at 13:10
  • I am cleaning up my question over here: http://stackoverflow.com/questions/12854261/elements-of-oauth-2-0-proxy-requesting-envlope-for-wso2-esb – Ack Oct 12 '12 at 07:43