Vik
Vik

Reputation: 9289

Google Drive API behavior

I am using google app engine for java and trying to read some documents using google drive api.

The auth url passes offline access and for the first time when the app is running it ask me to login to a google account.

I have my GAE running on my gmail id associated account. But the google drive I am trying to access is associated to my google apps account. So, at login screen I provide the credentials for my google apps account.

However, what is happening is that it is still returning me the files from my gmail account drive.

Any idea why that happens and how to point it to my google apps account associated drive?

Upvotes: 0

Views: 127

Answers (1)

pinoyyid
pinoyyid

Reputation: 22286

When you are accessing Drive using the SDK, you pass an access token (hidden in a Credential object). That access token is what associates the API call with a particular Drive account. It is the responsibility of your app to use the correct access token (Credential). Without seeing your app, it's nigh on impossible to tell you what you are doing wrong.

One thing to be aware of. You say "GAE running on my gmail id". That could mean "my appengine application is owned by my gmail id". It could also mean "I use GAE's authentication mechanism to login to the app". Neither of these are related to the Google Account access token that you are using to access Drive. It might be that you've confused the Appengine Login Id with your Google Accounts ID. They are different. In general, if you are using Oauth for authentication and access, you should probably not be using Appengine's authentication aswell.

Upvotes: 1

Related Questions