Nintendo Switch Authentication - ReturnCode: 32755 (Token invalid (format))

Options
Hi, I’m hoping to get some help with our application which we are developing for Nintendo Switch.

I have just gone through the Switch stuff on the Nintendo site and got our application ID and we are at the Setup Complete stage. According to the forums posts and documentation I can find under Nintendo we have to be at that stage BEFORE we can get a valid Authentication Token.. so we’re there and I assume are good.
Next I created a Nintendo User, made them a Network User and used the Nintendo Membership Manager to authorise that user as a Nintendo Switch Online.
Have added the Nintendo Switch App ID to the Photon App that we have
I have set the Unity Publishing Settings App ID to the the same Nintendo Switch App ID.

So far so ‘seems’ good.

I am able to run through the calls using the Nintendo API to get the lines of code in the Photon Switch documentation for the token to succeed.

The 2nd line in the documentation was failing until I got into the SetupComplete phase of the application on the Nintendo site – prior to that I was using the default AppID for both.
The above line fills token buffer which is a byte[]
The sample code and documentation then suggests to add a null at the end, so the token is trimmed to fit.

Every things succeeds, that trimmedToken gets filled with data (I’m not sure what it should be, but it’s got something), so we then move on to the problem area, trying to Authenticate with Photon using that trimmedToken a byte[]

I then do:
PhotonNetwork.AuthValues = new AuthenticationValues();
PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.NintendoSwitch;
PhotonNetwork.AuthValues.AddAuthParameter("token", trimmedToken.ToString());

I seem to have to .ToString() it because the AuthParameter dictionary is string, string? But I fear that this is the issue.

I get the following error turned after calling PhotonNetwork.ConnectUsingSettings(gameVersion);

Operation failed: OperationResponse 230: ReturnCode: 32755 (Token invalid (format)). Parameters: {} Server: NameServer
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update()

Custom Authentication failed (either due to user-input or configuration or AuthParameter string format). Calling: OnCustomAuthenticationFailed()
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update()

Can anyone help me figure out what part of this I’m doing wrong or how I need to format that byte[] as I’m thinking that is the ‘invalid format’ that is returned.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options

    Hi @Wendell,

    Thank you for choosing Photon!

    Consoles support cannot be public.
    Please send an email to developer@photonengine.com.

This discussion has been closed.