Google Drive HTTP 403 "Access Not Configured" error with DrEdit - google-drive-api

I'm attempting to install the DrEdit sample app for python onto GAE. The app runs, but saving or opening a file results in an HTTP 403 "Access Not Configured Error".
client.json has client_id and client_secret set per the API Access>Client ID for Drive SDK values. I have also attempted to use the values for API Access>Client ID for web applications.
The Google Drive SDK> OAuth Client ID has also been set variously to the Drive SDK and web app Client IDs.
What am I doing wrong?

In the services section of the Google API console there are two services relating to drive development, SDK and API. When you create a new Drive SDK entry, Drive API service is not automatically enabled (which doesn't make sense, I don't see when you'd create a drive enabled application without using the drive API). Switch the Drive API service on for the project and try again.
#lurking_googlers I think a lot of people will fall for this, doesn't it make sense to enable the API when the SDK is enabled?

And your must also identify in your code the following
DriveService.Scope.DriveFile, DriveService.Scope.Drive
good luck

Related

What to put as 'Authorized Domain' under Firebase authentication for a single page Google App Script webapp

In my Google App Script webapp, I would like to implement Firebase Phone authentication using FirebaseUI. But I am getting an error 'Hostname match not found' error when authenticating after reCaptcha verification.
So, please help me to understand:
If Firebase phone auth can be implemented for GAS webapps using FirebaseUI?
If yes, then what should I put as the 'Authorized Domain'? (I have tried with script.google.com, but it did not work)
Edit: After further studying, I found that the GAS webapp is served over a subdomain of script.googleusercontent.com and was able to use FirebaseUI phone auth by adding the subdomain as 'Authorized Domain' under Firebase auth.
Now, I would like to understand:
The subdomain over which a GAS webapp is served, is it exclusive and static per appscript project?

Am I able to use dropbox or google drive as a storage in my website?

I'm just having a site and I don't want to store the user uploaded Files in my server . I want to store it in a cloud server or storage like gdrive or dropbox. Is this possible todo?
You can simply use the Google Drive API for achieving this. Google Drive API is using OAuth 2.0 Authentication. You can find API Endpoints and Authentication methods from below link.
https://developers.google.com/drive/api/v3/manage-uploads

Access Not Configured. The API is not enabled for your project

I am trying to enumerate group members from Google Apps Script using the following code:
AdminDirectory.Groups.get("scouts#troop1313.com")
and getting this message
Access Not Configured. The API (Admin Directory API) is not enabled for your project. Please use the Google Developers Console to update your configuration. (line 65, file "Code")
I already authorized the script/project by running it directly from the online IDE but that did not help.
The project key is Mcdd3jWb8x_CBgWbrqpOo7WzCrlavxzZ2 and the function I am calling is getFolderContents.
Just a head up, Admin Directory API renamed to Admin SDK on API Manager.
Find that API and enable it helps solve the problem.
For advanced Google API's like the Admin Directory service you need to enable the service within your Google account's "developer console".
This authorisation is required in addition to the stock Apps Script authorization dialogues you mention in your question.
See the instructions here:
https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services

google drive api access not configured

I am following the google drive android quick start sdk here. The only difference is that I am using intellij instead of eclipse.
The app throws an exception when uploading the file:
File file = service.files().insert(body, mediaContent).execute();
The exception message is access not configured.
Now googling this error yields some results:
google drive api error 403 Access Not configured
Google Drive HTTP 403 "Access Not Configured" error with DrEdit
I have checked in the google cloud console that both the drive api & the drive sdk are activated. I have registered an app with the correct package name. I also added google cloud storage just in case. What else should I check?
Edit
I am really confused by the documentation. This page mentions the getToken method, but the sample application uses GoogleAccountCredential.usingOAuth2 which documentation is Constructor a new instance using OAuth 2.0 scopes.
When registering the application, I get some information like client secret/client ID. I could find information here explaining how to use this data, but I could not find this kind of example for an android app.
In the API Console, when you register/create an app, a Client ID is generated. Have you coded that Client ID into your app? The answer to the first SO link you gave has details.

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.