Hello,
I’m using the official Game Engine plugin for Unreal and so far I think I’ve set up everything I need correctly. I can do the entire Login Flow, authenticate, subscribe to events such as point rewards etc.
However, after a while (couple of hours) I get an “Invalid OAuth Token” error message and my game loses the connection and the player has to log in again. I’m assuming the token expires?
In the documentation I’ve seen there is a RefreshOAuthToken() function, but that doesn’t seem to be accessible through blueprints.
Am I missing something or is the plugin just broken?
EDIT:
I think I might have resolved the issue. I need to test longer since I basically need to wait for the 4 hour expiry of the token to see whether it will refresh.
I will edit this again once I’ve confirmed whether it works or not.
What I changed was the Client Type in the Twitch Developer Console. I had it set to Confidential which gives you a client secret. When the plugin tries to refresh its token internally, an error code is returned because the plugin does NOT send the client secret in its request. When the client type is changed to public, there is no client secret anymore.
Besides, it says in the description of the type that public is meant for the game engine plugin.
I really hope that solves the issue. Will update after further tests. I did a manual token refresh and it worked. But I hope it’ll just do it on its own from now.