Hi, The GData Java library doesn't support OAuth 2.0 yet, but you can use OAuth 1.0. Please check the Java code at
http://code.google.com/apis/gdata/docs/auth/oauth.html#Examples Claudio On Thu, Mar 29, 2012 at 1:26 AM, sunz <[email protected]> wrote: > Hi.. > > I am in a strange problem. I am writing an application in core java which > needs to access its own account at google docs. So after doing a lot of > googling, I found that OAuth2.0 with Service Account is something I am > looking for. But I am not using App Engine or anything. Its a simple > application. I don't know how can I use the OAuth. I have written below > code and I dont know how to proceed further. Looking for someone to guide > me further: > > GoogleCredential credential = new > GoogleCredential.Builder().setTransport(HTTP_TRANSPORT).setJsonFactory(JSON_FACTORY) > > > .setServiceAccountId(EMAIL) > > .setServiceAccountScopes(SCOPE) > > > .setServiceAccountPrivateKeyFromP12File(new File("lib/key.p12")).build(); > > SpreadsheetService service = new SpreadsheetService("My test Service"); > //service .setOAuthCredentials(parameters, signer); > > Please help. > > >
