- I ensure that I'm using the PlayFab token for Photon (and not directly from them).
- I login to PlayFab via email or FB
- I call PhotonCustomAuthRequest()
- On the callback returning an PhotonCustomAuthenticationToken, I call PhotonMgr.SetAuthVals:
// Need some auth values (before we connect) AuthenticationValues customAuth = new AuthenticationValues(); // Important: Select authentication type (how / where the auth is verified) customAuth.AuthType = CustomAuthenticationType.Custom; // The demo authentication-service expects values for "username" and token customAuth.AddAuthParameter("username", pfUsername); customAuth.AddAuthParameter("token", _photonAuthTicket); // Connect to the photon server PhotonNetwork.ConnectUsingSettings(PHOTON_GAME_VER); Debug.LogFormat("PlayFab Auth Ticket Received: {0}", _photonAuthTicket); Debug.Log(PhotonNetwork.AuthValues.ToString()); // Ready PhotonNetwork.AuthValues = customAuth;
Here is what unexpectedly returns:
Operation failed: OperationResponse 230: ReturnCode: 32755 (Failed to parse token from request). Parameters: {} Server: NameServer UnityEngine.Debug:LogError(Object) NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1534) ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[]) ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:15