Photon Refreshing Authentication Token

Hi guys, I have a problem with a project. I have a server like application in Unity. The app is always connected to the Master Server and to lobby. It is checking if a new room has been created and joins to it. The problem is the time between game rooms may vary and after a certain amount of time waiting in lobby, I can not join a room. It says authentication token is expired and I disconnect and reconnect to the master server/lobby to get a new token.

I made some research and saw some posts about raising events/RPC's periodically but I am not in a game room and I believe I can not raise events etc. in lobby.

How can I refresh my authentication token or stay active in the lobby so my token won't get expired?

Comments

  • Hi @atriko,

    Thank you for choosing Photon!

    The token refresh happens only on Game Server (room) only.
    I don't think it's possible on Master Server (lobby).

    Maybe @chvetsov can add more here?
  • Hello @JohnTube,

    Thank you for your answer.

    Is there any workaround for this you can think of? Can you tell me what are the cases that a connected client loses it's token?

    I am thinking about creating a room and leaving it just to refresh it. Do you think this can be useful?
  • hi, @atriko

    When you connected to master there is no mechanism to update token if you stay connected a long time. You get a new token with Auth response only.

    On GS if you joined a game you will get automatic updates for the token if you stay the quite long

    best,
    ilya
  • @chvetsov

    Thank you for your response. I guess I will think about another solution for this. But your response was really helpful.

    Have a nice day
Sign In or Register to comment.