gspread-pandas icon indicating copy to clipboard operation
gspread-pandas copied to clipboard

Run gspread-pandas on a remote server and authenticate at the user browser using OAuth

Open bmt8 opened this issue 3 years ago • 3 comments

Is it possible to run the gspread-pandas on a remote-server (like aws ec2) and allow the user to authenticate using their local browser (google chrome on their machines)?

I have a use case where I'd create ephemeral VMs/Containers and let users SSH into it and thei use their own google credentials (which demands OAuth). I tried this but when the gspread-pandas prompts the link to login to google and the user open it on their local browser (localhost), they can fill the google info but at the last screen it can't redirect back to the server, and the terminal which is running the python script keeps waiting the login (which already broke).

I may need to open a ssh-tunnel between local host and the remote server so the python script on remote can listen to the 8182 of the local browser?

Thanks

bmt8 avatar Aug 04 '22 13:08 bmt8

Hi, sorry for the delayed response. Unfortunately I believe that workflow was broken with Google's recent deprecation of OOB flow. They have the following page which might be helpful: https://developers.google.com/identity/protocols/oauth2/resources/oob-migration.

I think the easiest option is to either run it locally and copy the config over, or use a service account, but it's possible the tunnel might work.

aiguofer avatar Oct 07 '22 19:10 aiguofer

If you find a solution, a contribution to the README for others would be really helpful!

aiguofer avatar Oct 07 '22 19:10 aiguofer

@bmt800 were you able to figure out a solution to this? Thanks!

zakelhjouji avatar Oct 26 '22 15:10 zakelhjouji