Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send data back to Script (from local Browser) #114

Open
X-Nightmare-X opened this issue Mar 18, 2024 · 1 comment
Open

How to send data back to Script (from local Browser) #114

X-Nightmare-X opened this issue Mar 18, 2024 · 1 comment

Comments

@X-Nightmare-X
Copy link

Hey, do you have a workaround or some idea how i can make it work that i accept the OAuth Client Site and then not referring to ...my local 127.0.0.1?

I mean i got all things running. The only thing is, that after confirming and accepting all at the Google OAuth site, its redirects me to local. I dont know how to get the data back there. I would appreciate if you add some sort of chosing between this behavior like it is now and an extra version where i can add the needed keys or whatever to the CLI from my local Brower/URL.

Sorry for bad english. If there are questions about this please ask.

Thanks for helping..

@X-Nightmare-X
Copy link
Author

Found temporary workaround.
But i think that's not really secure because its over http.

Get all steps done until you could do the "drive account add" then enter the keys.
After that you get the link.
Then open the link and set permission on the Google OAuth Site.
If you get redirected to the 127.0.0.1:8085?KEYXXXX-XXX
then enter your own Server IP Adress and send the query to the Server.

To get that working you have to change 1 setting and set an iptables preroute.

sysctl -w net.ipv4.conf.all.route_localnet=1
iptables -t nat -I PREROUTING -p tcp --dport 8085 -j DNAT --to 127.0.0.1:8085

Dont forget to directly set it back, for security reasons.
sysctl -w net.ipv4.conf.all.route_localnet=0

Before i had done this i saved my iptables if something goes wrong or anything other problems.

  1. iptables-save (Save current/existing rules to a file)
  2. iptables-restore (Restore back the saved rules from the file)

iptables-save > iptables.save
iptables-restore < iptables.save

Hope this helps some people for getting it done as fast as possible without having access to a browser on the remote host.

I would appreciate if you could add some mechanism that you can enter the code in the CLI without doing it like that.

Thx! :D

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

No branches or pull requests

1 participant