Error after Facebook login

I have import facebook and PUN sdk.
After successesfull login from FB I get error.
Error 1: Operation failed: OperationResponse 230: ReturnCode: 32755 (no valid). parameters: {} Server: NameServer
Error 2: custom Authentication failed (either due to user-inputt or configration or AuthParameter string format). Calling: OnCustomAuthenticationFailed()

Code:
var aToken = AccessToken.CurrentAccessToken;
var facebookId = AccessToken.CurrentAccessToken.UserId;
PhotonNetwork.AuthValues = new AuthenticationValues();
PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.Facebook;
PhotonNetwork.AuthValues.UserId = facebookId; // alternatively set by server
PhotonNetwork.AuthValues.AddAuthParameter("username", facebookId.ToString());
PhotonNetwork.AuthValues.AddAuthParameter("token", aToken.ToString());
PhotonNetwork.ConnectUsingSettings("1.0");

Best Answers

  • rmehta
    rmehta
    Answer ✓
    No problem. It will be helpful to other.

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @rmehta,

    Thank you for choosing Photon!

    Did you properly setup custom authentication for your appId from dashboard?
    Do you use same appId in client as well?
  • Hello @JohnTube
    I have set appid and secret key inside Facebook Provider.
    And i am using same appid in unity. I can login to my test account. but then i get this error
  • Thanks,

    working perfect. ToString() was the issues .
  • JohnTube
    JohnTube ✭✭✭✭✭
    I'm glad you got it working.
    I apologize about the inconvenience. Documentation will be updated soon.
  • rmehta
    rmehta
    Answer ✓
    No problem. It will be helpful to other.
  • JohnTube wrote: »
    Make sure you did setup facebook app in Unity. Go to "Facebook -> Edit Settings" and copy your facebook AppId there.
    Try this (first line changed):string aToken = AccessToken.CurrentAccessToken.TokenString; string facebookId = AccessToken.CurrentAccessToken.UserId; PhotonNetwork.AuthValues = new AuthenticationValues(); PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.Facebook; PhotonNetwork.AuthValues.UserId = facebookId; // alternatively set by server PhotonNetwork.AuthValues.AddAuthParameter("username", facebookId)); PhotonNetwork.AuthValues.AddAuthParameter("token", aToken); PhotonNetwork.ConnectUsingSettings();

    I just tried it and it works.

    hey even after using this I'm getting the same error
    OperationResponse 230: ReturnCode: 32755 (no valid). Parameters: {} Server: NameServer Address: ns.exitgames.com:5058

    anything which I'm doing wrong