It turns out that there are excellent classes in the Google libraries to make OAuth absolutely trivial, in fact it's really only 3 lines:
- Construct your AuthorizationCodeFlow
- Construct your AuthorizationCodeInstalledApp
- Ask the InstalledApp to authorize the client
Now to make this happen you're going to need to include the relevant Google libs. You can find lots of good info about the libs here google-api-java-client, google-oauth-java-client and google-http-java-client.
The libs necessary for the above are:
Great !!
ReplyDeletePlease note:
1) maven repo
google-api-services
http://mavenrepo.google-api-java-client.googlecode.com/hg
true
true
2) And current drive API
com.google.apis
google-api-services-drive
v2-rev9-1.8.0-beta
Thanks.
Thanks Olivier, I've added those changes.
ReplyDeleteI was using http://google-api-client-libraries.appspot.com/mavenrepo as the repository. Which I seem to have taken from http://code.google.com/p/google-api-java-client/wiki/APIs.
But perhaps the one I was using is an internal Google maven repository because it can't be navigated by browser and it contains more recent artifacts such as google-api-services-drive:v2-rev41-1.13.2-beta