Do Service Accounts created in the Developers Console for a specific apps user (e.g. user@mydomain.com) have access to the app user's documents? If I set the account in the AssertionCredentials()
like this:
$credentials = new Google_Auth_AssertionCredentials(...);
$credentials->sub = "user@mydomain.com";
I receive the following error:
PHP Fatal error:
Uncaught exception 'Google_Auth_Exception' with message
'Error refreshing the OAuth2 token, message:'{
"error" : "unauthorized_client",
"error_description" : "Unauthorized client or scope in request."
}
When I don't set $credentials->sub = "user@mydomain.com"
I am able to access the drive but I only see the one document "How to get started with Drive".
If I create the document on the Service Account, is there any way to transfer ownership of the document to my apps account without enabling domain wide delegation?