#Store Access Token for future app launches

1 messages · Page 1 of 1 (latest)

nocturne orbit
#

Hi all! I was wondering if this asset handles storing the access tokens received when a user logs in, so they don't have to login every time they open the game. I saw some code in TwitchAuthenticationHelper.cs relating to PlayerPrefs but I can't find anything in the documentation about it. Thanks!

nocturne orbit
#

Or should I store it encrypted locally myself 🤔

magic flicker
#

Hi!
Yes, the asset does store the AT and RT, when AutoRefresh is enabled.
In this case, the OnAuthenticationFinished callback is called immediately after the token is refreshed, which is done on Start with one frame delay to allow all game logic to initialize.

#

If your application needs to know if a token is stored at all, you can check PlayerPrefs:

                string refreshToken = PlayerPrefs.GetString("Firesplash.TwitchAuthentication.Store." + UniqueIdentifier + ".RT", "");
                string accessToken = PlayerPrefs.GetString("Firesplash.TwitchAuthentication.Store." + UniqueIdentifier + ".AT", "");

But as you can see, it is not stored in encrypted form.