AuthTokenKey and UE4 example

From what I can gather, the UE4 example does not require an AppID or an AuthTokenKey if I am self hosting the SDK example server?

I installed the LoadBalancing example Photon server on our server which is exposed to an external IP. I can connect to the server just by using this external IP address.

What is the purpose of the AuthTokenKey in Photon.LoadBalancing.dll.config?

Also, I do not need an AppID if I am self hosting?

For reference I modified the connect to the following:
mpClient->connect(ExitGames::LoadBalancing::AuthenticationValues().setUserID(*UserID), ExitGames::Common::JString(L"UR") + GETTIMEMS(), *serverAddress, ExitGames::LoadBalancing::ServerType::MASTER_SERVER);

Thanks

Comments

  • hi, @eza
    AuthTokenKey is used to encrypt tokens. it should be same on master and on GS

    >Also, I do not need an AppID if I am self hosting?
    no, you do not need it

    best,
    ilya
  • Kaiserludi
    Kaiserludi admin
    edited March 2019
    Hi @eza.

    The Photon clients don't ever require you to provide an authTokenKey through their APIs, no matter if your are using them with a self hosted Server or with the Photon Cloud.

    The encrypted auth token gets provided to them by the Photon Server name server (if their initial connect is to a name server) or master server (if their initial connect is to master server) in response to their initial successful authentication to Photon and updates to it get sent by the server over time and both, the initial token as well as updates of it get automatically applied by the client internally.
    The client also automatically uses the latest available token that it got supplied with on further authentications.
    Whenever it switches the Photon server under the hood (every time it enters or leaves a room, it will disconnect from the master and connect to the game server on which that room is hosted and vice versa), the client needs to authenticate on the server to which it connects and uses the token for that.

    This is all automatically handled by the client under the hood and you don't have to do anything here.

    On the client side the token never needs to get decrypted, so the client doesn't need to know the auth token key at all.

    However as @chvetsov has already mentioned the auth token key needs to match between a master server and all game servers that are connected to it, so that game servers are able to decrypt the token that the master has encrypted and can verify that it is valid.
  • Thank you for the explanation.