gdrive icon indicating copy to clipboard operation
gdrive copied to clipboard

[AUTH] Sign in with Google temporarily disabled for this app

Open ricardosllm opened this issue 5 years ago • 15 comments

After installing gdrive through homebrew and trying to list documents with

❯ gdrive list                                                                                                                                                    14:50:18
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=masked-client-id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code:

I get the following:

image

Url: https://accounts.google.com/signin/oauth/danger?authuser=0&part=xxxxxxxxx-masked-xxxxxxxxx

ricardosllm avatar Apr 29 '20 06:04 ricardosllm

Yep I get that too

AdamMarciniak avatar Apr 29 '20 15:04 AdamMarciniak

Ah follow the tutorial for the pinned issue: https://github.com/gdrive-org/gdrive/issues/533

AdamMarciniak avatar Apr 29 '20 16:04 AdamMarciniak

Any word on when this might be fixed without the workaround? I would like to use this with my corporate Gsuite account (and enable others to do so, too) and we won't have access to generate our own credentials the way it is suggested in the workaround.

Thanks.

juliusbaxter avatar Apr 30 '20 07:04 juliusbaxter

Open a project and generate yourself Desktop OAuth client ID credentials.

https://console.developers.google.com/?pli=1

clone the source

git clone https://github.com/gdrive-org/gdrive.git cd gdrive/

change the two parameters you generated for yourself

const ClientId = const ClientSecret =

vi handlers_drive.go

get dependencies

go get github.com/prasmussen/gdrive

build your custom gdrive

go build chmod +x gdrive mv gdrive /usr/local/bin/

go and activate your OAUTH. Probably getting red alert but in your own app you can continue

gdrive about

PS: another WAR is generating on the same page a service account and use the param all the time:

mkdir -p ~/.gdrive mv atomic-segment-201915-x.json ~/.gdrive/ gdrive about --service-account atomic-segment-201915-x.json

fluidum avatar May 09 '20 17:05 fluidum

What application type should we choose when we create OAuth client ID? #553 批注 2020-06-25 123820

kayzhou avatar Jun 25 '20 04:06 kayzhou

@kayzhou

You can choose Desktop app. Read more: https://github.com/mbrother2/backuptogoogle/issues/19

mbrother2 avatar Jun 25 '20 04:06 mbrother2

It works @noraisk thanks

woshidama323 avatar Jul 02 '20 15:07 woshidama323

There is no 'go' on windows 10. Is there any alternative?

Urbaner3 avatar Jul 15 '20 07:07 Urbaner3

@Urbaner3 you need to install it it's a programming language like C++/Java/Javascript... so it doesn't come bundled with Windows

LiberQuack avatar Jul 20 '20 17:07 LiberQuack

@noraisk Hi, I stuck with this

gdrive about --service-account  one.json
Failed getting oauth client: google: read JWT from JSON credentials: 'type' field is "" (expected "service_account")

I choose the Desktop option for OAuth client ID? But I still do not find the service_account key in json.

linnabrown avatar Dec 10 '20 17:12 linnabrown

Error 403: access_denied

The developer hasn’t given you access to this app. It’s currently being tested and it hasn’t been verified by Google. If you think you should have access, contact the developer (my-gmail-address). Learn more Request Details access_type=offline response_type=code redirect_uri=urn:ietf:wg:oauth:2.0:oob state=state client_id=517452042405-qsa19i9n581s5a8r2116c858ps8apgaq.apps.googleusercontent.com scope=https://www.googleapis.com/auth/drive

linnabrown avatar Dec 10 '20 20:12 linnabrown

@linnabrown double click your OAuth 2.0 Client IDs record name. When new page opens there is a button download JSON. Feed that configfile into app. Also make sure that your OAuth token is created under Google Drive API.

fluidum avatar Dec 10 '20 20:12 fluidum

Open a project and generate yourself Desktop OAuth client ID credentials.

https://console.developers.google.com/?pli=1

clone the source

git clone https://github.com/gdrive-org/gdrive.git cd gdrive/

change the two parameters you generated for yourself

const ClientId = const ClientSecret =

vi handlers_drive.go

get dependencies

go get github.com/prasmussen/gdrive

build your custom gdrive

go build chmod +x gdrive mv gdrive /usr/local/bin/

go and activate your OAUTH. Probably getting red alert but in your own app you can continue

gdrive about

PS: another WAR is generating on the same page a service account and use the param all the time:

mkdir -p ~/.gdrive mv atomic-segment-201915-x.json ~/.gdrive/ gdrive about --service-account atomic-segment-201915-x.json

As of may 2021, this method is no longer working.

naivomah3 avatar May 10 '21 11:05 naivomah3

@naivomah3 Here is a Woking one, I used the official golang Docker image for go 1.16

Open a project and generate yourself Desktop OAuth client ID credentials.

https://console.developers.google.com/?pli=1

clone the source

git clone https://github.com/gdrive-org/gdrive.git cd gdrive/

change the two parameters you generated for yourself

const ClientId = const ClientSecret =

vi handlers_drive.go

get dependencies

go get github.com/prasmussen/gdrive

Create mod file

echo "module gdrive" >> go.mod

finde dependencies on machine

go mod tidy

~~build your custom gdrive~~

~~go build~~

build your custom gdrive but with this command

go build -mod=readonly -ldflags '-w -s'

chmod +x gdrive mv gdrive /usr/local/bin/

go and activate your OAUTH. Probably getting red alert but in your own app you can continue

gdrive about

PS: another WAR is generating on the same page a service account and use the param all the time:

mkdir -p ~/.gdrive mv atomic-segment-201915-x.json ~/.gdrive/ gdrive about --service-account atomic-segment-201915-x.json

CREDIT: https://stackoverflow.com/a/52243548

ttt-t-ttt avatar Jul 05 '21 15:07 ttt-t-ttt

made it look nice: https://gist.github.com/ttt-t-ttt/db7e46f6b4619797f0def9db9457a064

ttt-t-ttt avatar Jul 05 '21 17:07 ttt-t-ttt