oauth 2 token google api redirect uri handeling

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RBdev

hello i started working on a google api interface for sheets firebase and such.
you can read with the from the google api’s fine only using the api key.
the trickey part is writing to the api because you need the api Oauth2 token and that is a handfull to get the only thing i need to do now is handle the redirect URI :

https://accounts.google.com/o/oauth2/v2/auth?client_id=981207562170-qncje5otb4d5r5l2qrftdtde1kobkmiu.apps.googleusercontent.com&response_type=code&redirect_uri=https://127.0.0.1&scope=https://www.googleapis.com/auth/drive.file

it looks like this. when you would use the url in the httprequest node you get a lot of html code back. wich is the code for user consent webpage. if you do it with shell open you get the correct page in your browser.

after having given consent you are redirected to youre redirect url:
https://127.0.0.1/?code=4%2F0AY0e-g59AaaU5pUXLFBdlU7Je5ew_37fnhgGMCBDfqwYZHM8uab3eT_hjkcbpLPTv0DhFw&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file

now i need to get that URL from my browser in godot as a variable.
or receive it via anny of the gdNative server modules?

thanks for any responses.

Any luck on this? I have been stuck on the same part for a while and have just resorted to having Godot run a python script that gets the token and saves it so a JSON, but I would love to be able to do this entirely in Godot.

scrubswithnosleeves | 2021-11-15 14:27