gdrivefs icon indicating copy to clipboard operation
gdrivefs copied to clipboard

Access gdrive using service account credentials

Open dv-rastogi opened this issue 3 years ago • 3 comments

Is there any support for authentication using service account credentials in gdrivefs?

dv-rastogi avatar Jan 25 '22 10:01 dv-rastogi

gcsfs can do this, so you could have a look to see whether the credentials object created there, with gdrive scopes, would work here.

martindurant avatar Jan 25 '22 22:01 martindurant

I checked at the pydata-google-auth level that when I set the env var GOOGLE_APPLICATION_CREDENTIALS to the path to a JSON containing my client credentials that it picked up the right information provided. I think it will work the same for drivefs provided that your service account scope contains at least one of

scope_dict = {'full_control': 'https://www.googleapis.com/auth/drive',
              'read_only': 'https://www.googleapis.com/auth/drive.readonly'}

AlbertDeFusco avatar Mar 03 '22 21:03 AlbertDeFusco

I suppose this whole package could do with some cleaning and documentation, etc. I am glad it worked well for you, @AlbertDeFusco !

martindurant avatar Mar 03 '22 21:03 martindurant

I think this issue can be closed now, because #35 implemented support.

rhunwicks avatar Mar 01 '24 13:03 rhunwicks