Hello,
One of our servers is getting EntityTokenExpired error when attempting to access entity API. We're using C# SDK from a .net core application.
The problem is that we do have code to get an entity token. This is the code we use to get a token:
GetEntityTokenRequest tokenRequest = new GetEntityTokenRequest { Entity = new PlayFab.AuthenticationModels.EntityKey { Id = PlayFabSettings.staticSettings.TitleId, Type = "title" } }; PlayFabResult<GetEntityTokenResponse> tokenResult = await PlayFabAuthenticationAPI.GetEntityTokenAsync(tokenRequest);
We do some operations in our server for every logging in player, so the token should not be expired because I'm refreshing it every time. Yet 24 hours after starting the server, it begins giving EntityTokenExpired errors, even though I'm making GetEntityToken requests.
How do I refresh this token without restarting the server? I assume token is set on playfab's static settings and since there's a value there, GetEntityToken call does not refresh it automatically?
We set the developer secret key earlier in the code like this:
PlayFabSettings.staticSettings.TitleId = <mytitleid>; PlayFabSettings.staticSettings.DeveloperSecretKey = <mysecretkey>;