Failed to call function OnCustomAuthenticationResponse of ...

Options
Hello .
I am using PUN V1.6 . I use self hosting which for I use Photon version 4.0.28 . Everything works but I get errors in console for any class that I inherit from Photon.PunBehaviour . The error is this :
Failed to call function OnCustomAuthenticationResponse of class RealTimeNetworkManager
Calling function OnCustomAuthenticationResponse with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2113)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1261)
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:125)


this is my current config for server:




Note that if I set Enabled=false , I get another errors:

The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
Failed to connect to server: InvalidAuthentication

and nothing works anymore. I don't want to use custom authentication. Can you please guide me how can I solve this issue?
Thanks in advance

Comments

  • prince_of_persia
    edited March 2016
    Options

    Hello .
    I am using PUN V1.6 . I use self hosting which for I use Photon version 4.0.28 . Everything works but I get errors in console for any class that I inherit from Photon.PunBehaviour . The error is this :
    Failed to call function OnCustomAuthenticationResponse of class RealTimeNetworkManager
    Calling function OnCustomAuthenticationResponse with no parameters but the function requires 1.
    UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2113)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1261)
    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:125)


    this is my current config for server:




    Note that if I set Enabled=false , I get another errors:

    The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
    Failed to connect to server: InvalidAuthentication

    and nothing works anymore. I don't want to use custom authentication. Can you please guide me how can I solve this issue?
    Thanks in advance

    Opps current config:
    <AuthSettings Enabled="true" ClientAuthenticationAllowAnonymous="true">
    </AuthSettings>
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2016
    Options
    Hi @prince_of_persia,

    You can safely disable or remove custom authentication if you don't need it.

    Please make sure to select proper PUN settings from PhotonServerSettings inspector, set "Hosting" option to "Self Hosted" from dropdown list and set "Server Address" (e.g. 127.0.0.1) and "Server Port" (e.g. 5055).
  • JohnTube said:

    Hi @prince_of_persia,

    You can safely disable or remove custom authentication if you don't need it.

    Please make sure to select proper PUN settings from PhotonServerSettings inspector, set "Hosting" option to "Self Hosted" from dropdown list and set "Server Address" (e.g. 127.0.0.1) and "Server Port" (e.g. 5055).

    From the server setting ? I deleted it from the config file and Now I get the same error as I have disabled it:

    The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
    Failed to connect to server: InvalidAuthentication

    My Ip an Port settings are correct I Connect to the server and after few seconds I get this error and disconnect from the server.
  • Tobias
    Options
    You get the error:
    Failed to call function OnCustomAuthenticationResponse of class RealTimeNetworkManager
    Calling function OnCustomAuthenticationResponse with no parameters but the function requires 1.
    Check if you implemented a method OnCustomAuthenticationResponse and if it has the required parameter (Dictionary data).
    That should solve the exception issue.

    I will ask Hamza to post the exact setting to turn off custom auth on your server instance.

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2016
    Options
    Hey @prince_of_persia,

    We received your support ticket regarding this, replied and we are now waiting for your email. But we can always sort things out here on the forum which is better for everyone.

    What I understand from your situation is that you are using PUN to connect to a self hosted Photon Server (v4) but:

    1. If you keep default included Custom Authentication example configuration untouched:

    You get this error:
    Failed to call function OnCustomAuthenticationResponse of class RealTimeNetworkManager
    Calling function OnCustomAuthenticationResponse with no parameters but the function requires 1.
    Possible explanation:

    You changed the configuration to use a different endpoint URL or the default one is failing somehow. We should investigate this and fix any eventual issue. But this is not relevant to you since you do not require custom authentication.

    2. If you disable or remove Custom Authentication configuration (as explained here):

    You get this error:
    The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account. Failed to connect to server: InvalidAuthentication.
    Possible explanation:

    PUN client is trying to connect to Photon Cloud without a proper AppID. Please double check your PhotonServerConfiguration or send us a screenshot by email. Or which is less probable, you have made changes in the LoadBalancing application source code.
  • Tobias said:

    You get the error:

    Failed to call function OnCustomAuthenticationResponse of class RealTimeNetworkManager
    Calling function OnCustomAuthenticationResponse with no parameters but the function requires 1.
    Check if you implemented a method OnCustomAuthenticationResponse and if it has the required parameter (Dictionary data).
    That should solve the exception issue.

    I will ask Hamza to post the exact setting to turn off custom auth on your server instance.



    I used PunBehaviour class as the super class and I did not override OnCustomAuthenticationResponse so I don't think there is something wrong with this.
  • prince_of_persia
    edited April 2016
    Options
    Hi @JohnTube ,

    I responded to the email . But to share things here:
    1) I did not touch the source code for server
    2) I left the AppId field empty as you suggested in the email but still no progress
    3) We have gotten these errors since we updated our server version from v3 to v4. If I understood correctly custom authentication was added to the photon server v4 so I think there is something wrong with this.

    Thanks