Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Sign in with Google temporarily disabled for this app #533

Open
bravech opened this issue Feb 27, 2020 · 43 comments
Open

Sign in with Google temporarily disabled for this app #533

bravech opened this issue Feb 27, 2020 · 43 comments

Comments

@bravech
Copy link

bravech commented Feb 27, 2020

When I try to login to the link given by gdrive list, I'm brought to a page stating

Sign in with Google temporarily disabled for this app

This app has not been verified yet by Google in order to use Google Sign In.
@janakact
Copy link

janakact commented Mar 1, 2020

Same

@jbarrigafk
Copy link

same

@nathanaelytj
Copy link

Only Dev can do the verification, specifically the GDrive Dev (Petter Rasmussen). So this tool unusable until it's verification process completes.

@aleksijohansson
Copy link

Same here!

@lamhoangtung
Copy link

Same here

@rafatriolo
Copy link

same here

@rafatriolo
Copy link

update, actually this like worked for me

https://www.mynotepaper.com/mount-google-drive-using-gdrive-on-linux-server-with-own-oauth-credentials

@luccotta
Copy link

luccotta commented Mar 5, 2020

Same here

@michaellee8
Copy link

Same

@yarkm13
Copy link

yarkm13 commented Mar 7, 2020

No need to compile from source, just create service account in google console and use --service-account option

@quangpham
Copy link

No need to compile from source, just create service account in google console and use --service-account option

@yarkm13 can you help us with this? Any further information on how to make it works are very appreciated.

@nathanaelytj
Copy link

@yarkm13 @quangpham
Guide for those not compiling from source:

  1. Create Service Account & Download the JSON Key. You can follow Offical Google Guide here: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
  2. Create GDrive Config directory (should be in ~/.gdrive or /home/MYUSERNAME/.gdrive)
  3. Store JSON Key file in the GDrive Config directory (from Step 2) Tips: use easy name for JSON Key
  4. Run command gdrive --service-account [YOUR JSON KEY NAME HERE] about to test connection
  5. If error like this, follow the step 6-10. If error doesn't occur you can skip it:
    Failed to get about: googleapi: Error 403: Access Not Configured. Drive API has not been used in project [PROJECT_ID] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
    You should go to https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] as instructed.
  6. After Enabling API, you should create credentials for GDrive API by click Create Credentials, and choose Google Drive API from 'Which API are you using?' drop down list.
  7. Choose Other UI from 'Where will you be calling the API from?' drop down list.
  8. Choose User Data from 'What data will you be accessing?'
  9. Click on 'What credentials do I need?' now you will be instructed to create OAuth Client ID (Next Step).
  10. Choose Other, fill name for OAuth Client ID, then click Create. Done, just click Ok, no need to store Client ID or Secret.

Now the important bits is your Service Account have their own Google Drive space. This mean that if you upload file, it won't show up in your drive. To workaround this, your account need to create a shared folder with your service account email as the editor. See this Stackoverflow discussion: https://stackoverflow.com/questions/45492703/google-drive-api-oauth-and-service-account

Now to get the folder ID you can follow the tips from this blog: https://ploi.io/documentation/mysql/where-do-i-get-google-drive-folder-id
Use that folder id as parrent folder to store all of your files, and done! Your files now shows up!

IMPORTANT NOTE: There's an unmerged fix (#331) for changing ownership of files. For now GDrive util will throw error: 'Failed to share file: googleapi: Error 403: The transferOwnership parameter must be enabled when the permission role is 'owner'., forbidden'
This will results in the files uploaded is owned by your service account.

Hope this helps.

@yarkm13
Copy link

yarkm13 commented Mar 9, 2020

@quangpham i think @nathanaelytj has explained completely. I was done the same

@B05611003
Copy link

My personal Google account have much more Google Drive storage limit than the Service Account Free Google Drive space (16GB), is there any solution to link my personal account by Service Account OAuth?

@umayaml
Copy link

umayaml commented Mar 13, 2020

Same issue. Any ETA when this is going to get fixed?

@DanAlexson90
Copy link

Duplicate of: #506

@JurajMa
Copy link

JurajMa commented Mar 24, 2020

Issue still there. App still useless. The service account doesn't have enough space.

@yarkm13
Copy link

yarkm13 commented Mar 24, 2020

@JurajMa create directory in your main account and share it with service account email address. Now you need to point your service account to work with that directory.

@hikmawanaz
Copy link

@yarkm13 @quangpham
Guide for those not compiling from source:

  1. Create Service Account & Download the JSON Key. You can follow Offical Google Guide here: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
  2. Create GDrive Config directory (should be in ~/.gdrive or /home/MYUSERNAME/.gdrive)
  3. Store JSON Key file in the GDrive Config directory (from Step 2) Tips: use easy name for JSON Key
  4. Run command gdrive --service-account [YOUR JSON KEY NAME HERE] about to test connection
  5. If error like this, follow the step 6-10. If error doesn't occur you can skip it:
    Failed to get about: googleapi: Error 403: Access Not Configured. Drive API has not been used in project [PROJECT_ID] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
    You should go to https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] as instructed.
  6. After Enabling API, you should create credentials for GDrive API by click Create Credentials, and choose Google Drive API from 'Which API are you using?' drop down list.
  7. Choose Other UI from 'Where will you be calling the API from?' drop down list.
  8. Choose User Data from 'What data will you be accessing?'
  9. Click on 'What credentials do I need?' now you will be instructed to create OAuth Client ID (Next Step).
  10. Choose Other, fill name for OAuth Client ID, then click Create. Done, just click Ok, no need to store Client ID or Secret.

Now the important bits is your Service Account have their own Google Drive space. This mean that if you upload file, it won't show up in your drive. To workaround this, your account need to create a shared folder with your service account email as the editor. See this Stackoverflow discussion: https://stackoverflow.com/questions/45492703/google-drive-api-oauth-and-service-account

Now to get the folder ID you can follow the tips from this blog: https://ploi.io/documentation/mysql/where-do-i-get-google-drive-folder-id
Use that folder id as parrent folder to store all of your files, and done! Your files now shows up!

IMPORTANT NOTE: There's an unmerged fix (#331) for changing ownership of files. For now GDrive util will throw error: 'Failed to share file: googleapi: Error 403: The transferOwnership parameter must be enabled when the permission role is 'owner'., forbidden'
This will results in the files uploaded is owned by your service account.

Hope this helps.

if follow this step, but command gdrive --service-account will throw an error like this
No valid arguments given, use 'gdrive help' to see available commands
how to solved it?

@jerpint
Copy link

jerpint commented Mar 26, 2020

same issue as @hikmawanaz

@leonfilser
Copy link

same problem

@V3RGANz
Copy link

V3RGANz commented Apr 1, 2020

@nathanaelytj
On step 10 I first need to set up "OAuth consent screen", and only after this I can create OAuth Client ID. But obviously, I can't do it because it requires organization / website / verification from google / etc. How can I avoid this?
image

UPD: I have several accounts, and when I clicked "set up consent screen" for some reason google switched my account, after switching back everything works.
btw, use "Internal" OAuth type, just create name for consent screen and it works finally

@joemidi
Copy link

joemidi commented Apr 7, 2020

@yarkm13 @quangpham
Guide for those not compiling from source:

  1. Create Service Account & Download the JSON Key. You can follow Offical Google Guide here: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
  2. Create GDrive Config directory (should be in ~/.gdrive or /home/MYUSERNAME/.gdrive)
  3. Store JSON Key file in the GDrive Config directory (from Step 2) Tips: use easy name for JSON Key
  4. Run command gdrive --service-account [YOUR JSON KEY NAME HERE] about to test connection
  5. If error like this, follow the step 6-10. If error doesn't occur you can skip it:
    Failed to get about: googleapi: Error 403: Access Not Configured. Drive API has not been used in project [PROJECT_ID] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
    You should go to https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] as instructed.
  6. After Enabling API, you should create credentials for GDrive API by click Create Credentials, and choose Google Drive API from 'Which API are you using?' drop down list.
  7. Choose Other UI from 'Where will you be calling the API from?' drop down list.
  8. Choose User Data from 'What data will you be accessing?'
  9. Click on 'What credentials do I need?' now you will be instructed to create OAuth Client ID (Next Step).
  10. Choose Other, fill name for OAuth Client ID, then click Create. Done, just click Ok, no need to store Client ID or Secret.

Now the important bits is your Service Account have their own Google Drive space. This mean that if you upload file, it won't show up in your drive. To workaround this, your account need to create a shared folder with your service account email as the editor. See this Stackoverflow discussion: https://stackoverflow.com/questions/45492703/google-drive-api-oauth-and-service-account
Now to get the folder ID you can follow the tips from this blog: https://ploi.io/documentation/mysql/where-do-i-get-google-drive-folder-id
Use that folder id as parrent folder to store all of your files, and done! Your files now shows up!
IMPORTANT NOTE: There's an unmerged fix (#331) for changing ownership of files. For now GDrive util will throw error: 'Failed to share file: googleapi: Error 403: The transferOwnership parameter must be enabled when the permission role is 'owner'., forbidden'
This will results in the files uploaded is owned by your service account.
Hope this helps.

if follow this step, but command gdrive --service-account will throw an error like this
No valid arguments given, use 'gdrive help' to see available commands
how to solved it?

@hikmawanaz I found that the brew installation didn't have the --service-account global options available to it, but it did if I downloaded the binary and used that instead.

Once you'd uploaded files using a service account, how do you then pass ownership to your normal user account? I find it a bit odd having the owner and a service account.

@yarkm13
Copy link

yarkm13 commented Apr 7, 2020

@joemidi first create dir in your service account

./gdrive --service-account gdrive.json mkdir DIR_NAME

get object id of that dir

gdrive --service-account gdrive.json list

and grant permissions for your root account to that dir

gdrive --service-account gdrive.json share --role writer --type user --email 'YOUR_ACCOUNT_EMAIL' DIR_OBJECT_ID

Dont forget to setup sync to that dir, not in root

gdrive --service-account gdrive.json sync upload LOCAL_DIR_TO_UPLOAD DIR_OBJECT_ID --delete-extraneous

Bonus: wou will have extra 15Gb space on Google Drive (data stored by service account will not count in your root account)

@joemidi
Copy link

joemidi commented Apr 7, 2020

@joemidi first create dir in your service account

./gdrive --service-account gdrive.json mkdir DIR_NAME

get object id of that dir

gdrive --service-account gdrive.json list

and grant permissions for your root account to that dir

gdrive --service-account gdrive.json share --role writer --type user --email 'YOUR_ACCOUNT_EMAIL' DIR_OBJECT_ID

Dont forget to setup sync to that dir, not in root

gdrive --service-account gdrive.json sync upload LOCAL_DIR_TO_UPLOAD DIR_OBJECT_ID --delete-extraneous

Bonus: wou will have extra 15Gb space on Google Drive (data stored by service account will not count in your root account)

But doesn't this mean the folder I created is owned by the service account?

@yarkm13
Copy link

yarkm13 commented Apr 7, 2020

@joemidi according to gdrive help you also can grant owner role

./gdrive help share
Share file or directory
gdrive [global] share [options] <fileId>

global:
  -c, --config <configDir>             Application path, default: ~/.gdrive
  --refresh-token <refreshToken>       Oauth refresh token used to get access token (for advanced users)
  --access-token <accessToken>         Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
  --service-account <serviceAccount>   Oauth service account filename, used for server to server communication without user interaction (filename path is relative to config dir)

options:
  --role <role>       Share role: owner/writer/commenter/reader, default: reader
  --type <type>       Share type: user/group/domain/anyone, default: anyone
  --email <email>     The email address of the user or group to share the file with. Requires 'user' or 'group' as type
  --domain <domain>   The name of Google Apps domain. Requires 'domain' as type
  --discoverable      Make file discoverable by search engines
  --revoke            Delete all sharing permissions (owner roles will be skipped)

@yarkm13
Copy link

yarkm13 commented Apr 7, 2020

@joemidi also i think you can go opposite way: create directory in your root account and than grant permissions to it for service account. But I haven't tested that

@joemidi
Copy link

joemidi commented Apr 7, 2020

@yarkm13 Yes, I ended up doing it this way, you can just share the folder via the web UI, the folder is my own ownership but each file is created by the service account.

I did notice that owner role was available on gdrive share but it seems like it needs PR #331 to be complete due to an error message

Failed to share file: googleapi: Error 403: The transferOwnership parameter must be enabled when the permission role is 'owner'., forbidden

@nathanaelytj
Copy link

I forked this repository to https://github.com/ntechp/gdrive, merge gdrive-org#513, gdrive-org#270, gdrive-org#331
Download the merged source, build it with Go Lang Docker (https://hub.docker.com/_/golang). Use command docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:latest go build -v

All is in this non-official release note: https://github.com/ntechp/gdrive/releases/tag/2.1.0-0.0.1
and the binary goes: https://github.com/ntechp/gdrive/releases/download/2.1.0-0.0.1/gdrive-linux64

This fork temporarily fixes 3 probs:

  1. The OAuth Problem.
  2. The negative number for unlimited space for GSuite users.
  3. The transferOwnership Problem.

I do hope someone maintain this repository, merge all the fixes (because some of the issues already fixed by community), and update the release.

@Leotheone
Copy link

@yarkm13 @quangpham
Guide for those not compiling from source:

  1. Create Service Account & Download the JSON Key. You can follow Offical Google Guide here: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
  2. Create GDrive Config directory (should be in ~/.gdrive or /home/MYUSERNAME/.gdrive)
  3. Store JSON Key file in the GDrive Config directory (from Step 2) Tips: use easy name for JSON Key
  4. Run command gdrive --service-account [YOUR JSON KEY NAME HERE] about to test connection
  5. If error like this, follow the step 6-10. If error doesn't occur you can skip it:
    Failed to get about: googleapi: Error 403: Access Not Configured. Drive API has not been used in project [PROJECT_ID] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
    You should go to https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=[PROJECT_ID] as instructed.
  6. After Enabling API, you should create credentials for GDrive API by click Create Credentials, and choose Google Drive API from 'Which API are you using?' drop down list.
  7. Choose Other UI from 'Where will you be calling the API from?' drop down list.
  8. Choose User Data from 'What data will you be accessing?'
  9. Click on 'What credentials do I need?' now you will be instructed to create OAuth Client ID (Next Step).
  10. Choose Other, fill name for OAuth Client ID, then click Create. Done, just click Ok, no need to store Client ID or Secret.

Now the important bits is your Service Account have their own Google Drive space. This mean that if you upload file, it won't show up in your drive. To workaround this, your account need to create a shared folder with your service account email as the editor. See this Stackoverflow discussion: https://stackoverflow.com/questions/45492703/google-drive-api-oauth-and-service-account

Now to get the folder ID you can follow the tips from this blog: https://ploi.io/documentation/mysql/where-do-i-get-google-drive-folder-id
Use that folder id as parrent folder to store all of your files, and done! Your files now shows up!

IMPORTANT NOTE: There's an unmerged fix (#331) for changing ownership of files. For now GDrive util will throw error: 'Failed to share file: googleapi: Error 403: The transferOwnership parameter must be enabled when the permission role is 'owner'., forbidden'
This will results in the files uploaded is owned by your service account.

Hope this helps.

Thanks for this useful guide !
gdrive --service-account [YOUR JSON KEY NAME HERE] about command provides a positive return.
I also created dir in my service account and grant permissions for a root account to that dir, but unfortunately the issue remains : authentication needed when I launch any other gdrive command command (for ex : gdrive upload picture.png).
Have I forgotten something ?

@calvintwr
Copy link

For my case, each service account is limited to 16GB only. So I wasn't entitled to the unlimited quota of the Gsuite account.

@wyyqyl
Copy link

wyyqyl commented May 10, 2020

@joemidi first create dir in your service account

./gdrive --service-account gdrive.json mkdir DIR_NAME

get object id of that dir

gdrive --service-account gdrive.json list

and grant permissions for your root account to that dir

gdrive --service-account gdrive.json share --role writer --type user --email 'YOUR_ACCOUNT_EMAIL' DIR_OBJECT_ID

Dont forget to setup sync to that dir, not in root

gdrive --service-account gdrive.json sync upload LOCAL_DIR_TO_UPLOAD DIR_OBJECT_ID --delete-extraneous

Bonus: wou will have extra 15Gb space on Google Drive (data stored by service account will not count in your root account)

Thanks, it solved my problem

@quyleanh
Copy link

I forked this repository to https://github.com/ntechp/gdrive, merge #513, #270, #331
Download the merged source, build it with Go Lang Docker (https://hub.docker.com/_/golang). Use command docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:latest go build -v

All is in this non-official release note: https://github.com/ntechp/gdrive/releases/tag/2.1.0-0.0.1
and the binary goes: https://github.com/ntechp/gdrive/releases/download/2.1.0-0.0.1/gdrive-linux64

This fork temporarily fixes 3 probs:

  1. The OAuth Problem.
  2. The negative number for unlimited space for GSuite users.
  3. The transferOwnership Problem.

I do hope someone maintain this repository, merge all the fixes (because some of the issues already fixed by community), and update the release.

This method do help me. Thank you very much!

@skeith
Copy link

skeith commented May 25, 2020

gdrive --service-account creds.json about properly shows my account information, but upon trying gdrive upload command, it prompt me to open an URL which redirect me to login into my account and halted by Sign in with Google temporarily disabled for this app again

Anything I missed?

@AquariusPower
Copy link

AquariusPower commented May 26, 2020

I feel overwhelmed by all the steps required to make this work... and all the reports of failure just make me postpone it even more, mainly considering I can't even compile it. The "go" compiler wont accept anything I type, yes I am a "go noob", what is the "go" compile command? as the one at readme.md wont work :(, yes I installed the go-lang package, I am on linux.

So my question is, Why not just fix this:
"Sign in with Google temporarily disabled for this app"
"This app has not been verified yet by Google in order to use Google Sign In."

I mean, why not we join forces and beg google to verify this app!!!
Anyone knows how to do that? yes, the begging part...
(I found this tip tho: #533 (comment))

I mean, this app is great and should work "out of the box" and not require all these steps from noobs like me :/.
Obs.: I have it working without these steps on my desktop but fails on my notebook

@skeith
Copy link

skeith commented May 27, 2020

@AquariusPower I gave up on gdrive and switched to rclone.
Much easier to setup with service account

@AquariusPower
Copy link

AquariusPower commented May 27, 2020

@skeith
yeah, I am thinking on that too, as we dont know when gdrive will be properly fixed.
There are about 4 alternatives to gdrive.
I wanted gdrive because I made a script that 100% depends on it to do many things,
but may be I can replace it (and may be even what my script does with some other app).
thx on the tip :)

EDIT: I end up using this: https://github.com/odeke-em/drive#initializing, the best thing on it is that if you got very low quota (like 100MB/day) it will not try to synchronize, so you can just upload specific changes and use as little as possible of that horrible quota :)

@ttyridal
Copy link

ttyridal commented May 28, 2020

@AquariusPower

I mean, why not we join forces and beg google to verify this app!!!
Anyone knows how to do that? yes, the begging part...

It's not a google problem. The developer needs to initiate the verification. The result is that "join forces" boils down to someone forking the project (several have done so already) and paying the fee.

Without someone paying the fee, you'll have to do everything to "become the developer" yourself (because you don't have to pay the fee if you're only using it yourself)

@michaellee8
Copy link

@AquariusPower

I mean, why not we join forces and beg google to verify this app!!!
Anyone knows how to do that? yes, the begging part...

It's not a google problem. The developer needs to initiate the verification. The result is that "join forces" boils down to someone forking the project (several have done so already) and paying the fee.

Without someone paying the fee, you'll have to do everything to "become the developer" yourself (because you don't have to pay the fee if you're only using it yourself)

How much is the fee 😓

@nathanaelytj
Copy link

Offering my few cents ☺️

  1. For joining forces, I agree we as developers/contributors should join forces but we need to think who is responsible for controlling and handling user data through publicly Google verified app? Since anyone controlling the publicly Google verified app can theoretically access your entire Drive contents. Without clear definition of who's responsible for controlling and handling the publicly Google verified app, this app will become wetland for abuse.

  2. Google recently tighten the verification procedure for any public app that request some Google API.

If your public application uses scopes that permit access to certain user data, it must complete a verification process. If you see unverified app on the screen when testing your application, you must submit a verification request to remove it. Find out more about unverified apps and get answers to frequently asked questions about app verification in the Help Center.
From: https://developers.google.com/identity/protocols/oauth2/scopes

And requesting verification is free. The problem lies in creating App Home Page, App Privacy Policy, App Term of Service (App Term of Service marked as Optional by Google). Those legal things need to be present and tailored to fulfill Google Requirements before the app marked as verified.

  1. For fee part, this program actually licensed under MIT: LICENSE and if you read the LICENSE, you can see that you can do what you want in the application as long as you keep the notice. So, no fee. Though it's more of ethical side of things to ask for permission first if someone want to make it official that they take over app maintenance, development and do official releases.

@mbrother2
Copy link

Try backuptogoogle to compile gdrive with your own Google credential and auto backup on your server.

@ismdcf
Copy link

ismdcf commented Feb 23, 2021

    gdrive version 
    gdrive: 2.1.0
    Golang: go1.6
    OS/Arch: linux/amd64

I'm still unable to get the gdrive --service-account key.json about working

I Still get the error No valid arguments given, use 'gdrive help' to see available commands

@tanius
Copy link

tanius commented Jul 15, 2022

I believe this issue has been fixed 2021-05-28 and should be closed.

Quoting from the current README:

News
28.05.2021

gdrive is finally verified for using sensitive scopes which should fix the This app is blocked error. Note that the project name will show up as project-367116221053 when granting access to you account. (I don't dare to change any more settings in the google console.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests