Getting access to GDrive as app-specific user - google-drive-api

I am working with Google Drive from an application-specific account. It would be great to be able to get access to the GDrive UI logged with this account. Is this possible?

No, it is not possible to access the Google Drive web user interface of a service account.

Related

With Service account, Not getting any files / folder list with PHP

What will extra setting to get files / folder from google drive API with service account? Currently getting empty results.
Same code working with credential web scope with client id and secrets key but not with service account.
When you use a web client. It pops up and requests authorizaiton. In this way a user is granting your application access to their data. So a file.list will return the files on the users google drive account.
The same thing is happening with your service account. Only service accounts are pre authorized. Your file.list is returning no files becouse the service account doesnt have acess to any files yet. You see it has its own drive account.
Options.
Upload files to the service accounts drive account.
open your credetials.json file. Look for the service account email address. Take that address and share a directory or file on your personal drive account with the service account.
Now do a file.list. It should have files.

Transfer owner all documents to Administrator account using API (Google Drive)

I'm using Google Apps for Work. I try to take ownership for ALL file in user's Google Drive to Administrator account using APIs, via the latest Drive API http://support.google.com/a/bin/answer.py?hl=en&answer=1247799
With super admin permission, I can't use setownerto take ownership (action not allowed)
Only the owner of the file can grant access or ownership to other users. Even as admin, you won't have that kind of permission.
In order to accomplish this, as an admin you can "impersonate" the user and then perform actions on user's behalf.
This is done using service account with domain wide delegation permissions.
After doing this, you can call the API's as the user and give the admin(yourself) owner permissions of the user's files.
Hope this helps.

Box.com super account to get all the box.com users folders and files

I have a user cases to get all the box.com users folders and files through one single box.com super service account authentication without each single user's credentials like google drive did. Is it a way to do that through box.com api?
Eric
Yes you can if you have an enterprise account. You can use On-Behalf-Of feature in V2 API and can see other managed users' files and folders by authenticating as enterprise admin. Box will have to enable the On-Behalf-Of feature before you try this in your app.

Google Drive upload from webserver

I'm trying to make a service that runs on a webserver and can upload files to Google Drive,
so that people can sync the files to local-drive using the Google desktop application.
So I tried the Drive API but it requires a webbrowser to authenticate.
This would be a possibility, but I don't know to get the access token programmically.
Even if I had the access token, I wouldn't know if it just works forever.. It seems to have an expire date?
I wouldn't want the service to suddenly not working, because the token has expired.
Than I learned about Service Account, and finally got it working, but it seems to have its own space that i can only access with the service account.
I don't know how to share the files from the service account to a regular account, as people need to sync it locally.
So a found a video about user impersonation, in which he showed a page about given access to a service account to impersonate another user.
But i don't know where to find this page.
Looking at: http://support.google.com/a/bin/answer.py?hl=en&answer=162106&topic=2759255&ctx=topic
It says it's in Advanced Tools > Manage third party OAuth client access (under the Authentication section).
But where is the Authentication section? Do I need to create a Google App to do this?
The question is: How upload files programmically to Google Drive without any user intervention, so that they can be synced locally with the drive desktop-application.

How to transfer File Ownership for a Document which admin doesn't own?

Use Case
As admin service account, transfer Document Ownership using the Google Docs API, similar to the built in cPanel "Advanced Tools" -> "Document ownership transfer"
Constraints
APIs are being invoked in context of a Google Apps admin service account rather than the end-user account since APIs are being invoked from Google Apps Script in Sites page
Authorization is OAuth 1.0 since this is what Apps Script supports
What works:
Transferring ownership of the admin service account's own files to another user's account as documented here
What is required:
Transfer ownership of another user's files, ideally without them sharing any permissions with the admin service account; if there's no other way of doing it, they could share edit permissions on the file with the admin service account.
Currently this returns a
" ServiceException - You do not have permission to share these item(s):"
What you're trying to do is possible by impersonating the user using the admin account. The documentation shows how to do this here.
Essentially, start by requesting the API URL with default replaced with the current owner's email address. The request must be made while authorized as the admin user, though.
https://docs.google.com/feeds/user#yourdomain.com/private/full/
Once that URL is requested, all feed URLs will be returned with that email already present. Then, simply change ownership as you would normally.