public void ConnectToPhoton(string s)
{
string userId = s;
PhotonNetwork.AuthValues = new AuthenticationValues();
PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.Custom;
if (s == "swat")
{
userId = PlayerPrefs.HasKey("user") ? PlayerPrefs.GetString("user") : "user" + Random.Range(0, 1000);
}
else
{
userId = "asdf";
}
PhotonNetwork.AuthValues.AddAuthParameter("token", userId);
PhotonNetwork.ConnectUsingSettings(appVersion);
PhotonNetwork.ConnectToRegion(CloudRegionCode.@in, appVersion);
}
This is my code for custom Authentication and it works with my another Unity App successfully.
While working with my new game and I tried it the same way with same Authentication Url and Same Code but it fails with the error :
Operation failed: OperationResponse 230: ReturnCode: 32755 (aut failed). Parameters: {} Server: NameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1705)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
Custom Authentication failed (either due to user-input or configuration or AuthParameter string format). Calling: OnCustomAuthenticationFailed()
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1746)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:162)
As of now, I'm stuck for past two hours, any help would be appreciated. Thanks.