gspread-pandas
gspread-pandas copied to clipboard
Run gspread-pandas on a remote server and authenticate at the user browser using OAuth
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
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.
If you find a solution, a contribution to the README for others would be really helpful!
@bmt800 were you able to figure out a solution to this? Thanks!