I need to get the fragment of a OAUTH redirect url

Godot Version

4.2.2

Question

I followed the example shown below to get OAUTH working from godot. However, I was using an App Key and App ID. The service I am trying to use allows the use of a short term token just using the App ID allowing me to keep the App key secret and not in the client application (game). When I try to use the same method to retrieve the token (as when I was using both the App ID and App Key) it seems the service has changed how they provide the token. Using this new method the token is placed in the fragment of the redirect url.

Ex)
http://127.0.0.1:8080/#token=

It seems the StreamPeer and StreamPeerTCP classes do not have a way to get to this data as when I get data from the stream I only receive “/” along with metadata.

Any ideas or better ways to go about this would be appreciated.

Sources:

https://www.reddit.com/r/godot/comments/wgw3n7/oauth_20_in_godot_tutorialexample/

1 Like

I have the same issue. StreamPeer wont give the fragment and that is needed to get the token.

Any ideas on how to solve it?

I thought of a lengthy workaround where the callback is not directly on godot but a third party python app that get the token and then forwards it to godot. But seems not a good idea overall.