5

Now, we have an application with Google Docs Api and 2 legged oauth. However,we want to migrate to Google Drive Api which uses Oauth 2.0.

Can we use 2 legged oauth with Google Drive Api? Is there any example?

JoshN
  • 3
  • 2
user1454172
  • 123
  • 7

2 Answers2

2

You should use Service Accounts: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Claudio Cherubino
  • 14,896
  • 1
  • 35
  • 42
  • 2
    How is consumer key from Google Apps domain https://developers.google.com/accounts/docs/OAuth#tokensGADomains used in Service Accounts? I think Service Accounts can only be used, implemented in Third-party software vendors schema for 2-legged Google Apps. – user1454172 Sep 28 '12 at 11:34
  • Claudio, Can you describe how to use the Google Drive API with a Google Apps Marketplace App? How do we use service accounts in this scenario? – Edwin Jan 13 '13 at 02:07
-1

I just started looking into this and if I have any luck I will provide more info.

However, if you are using 2 legged oauth so you can work with google apps domain-wide then there is a published guide. I believe this is what the other answer was talking about.

Blog post explaining domain wide delegation: http://googleappsdeveloper.blogspot.com.es/2012/11/domain-wide-delegation-of-authority-and.html

Guide for the drive API: https://developers.google.com/drive/delegation

Bachmann
  • 748
  • 6
  • 12
  • Thanks Bachmann, but we know how to use the domain-wide delegation for the doc list api already. We're looking to use the Google Drive API for our app in the Google Apps Marketplace, which, from all I can see only gives us OAUTH 2-legged credentials. The Google Drive API only uses OAUTH 2.0, which does not support 2-legged credentials. I'm looking for a way, perhaps something that I overlooked, to use credentials from the Google Apps Marketplace to access Google Drive. – Edwin Jan 16 '13 at 05:11