Sometimes after a few days or so, my servers start getting EntityTokenExpired when users try to authenticate and I have to restart my servers.
Why am I getting this? how to get around it?
Sometimes after a few days or so, my servers start getting EntityTokenExpired when users try to authenticate and I have to restart my servers.
Why am I getting this? how to get around it?
For security, the EntityToken will expire after a certain period. The time the token will expire will be returned as a property(TokenExpiration) in GetEntityTokenResponse when you call GetEntityToken.
Based on your description, I guess your server will automatically call GetEntityToken when it restarts. This will cause the EntityTokenExpired Error to be fixed.
So, you can write a scheduled task in your server to call the GetEntityToken periodically before the token expires to avoid this Error.
Ok, thanks, I made it so that my server will call GetEntityToken 1 hour before expiration.
2 People are following this question.