Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug SignInWithFacebookAsync failure

Discussion in 'Authentication' started by MtCarmelGames, Nov 4, 2023.

  1. MtCarmelGames

    MtCarmelGames

    Joined:
    May 9, 2013
    Posts:
    5
    I'm in the midst of creating leaderboards for my game, and I've come across this issue with the AuthenticationService. Calling
    Code (CSharp):
    1. await AuthenticationService.Instance.SignInWithFacebookAsync(token);
    causes an exception "unable to validate token" every time.
    upload_2023-11-4_18-52-14.png


    I'm using Unity 2023.19f1 and Authentication V3.1.0.

    My Facebook app that I created is a Gaming type app, not Consumer type. I need the Gaming type to access things like the user's screen name and avatar.

    upload_2023-11-4_18-54-59.png
     
  2. erickb_unity

    erickb_unity

    Unity Technologies

    Joined:
    Sep 1, 2021
    Posts:
    90
    Hello

    We do not officially support the gaming app type at this time as mentioned in our documentation https://docs.unity.com/ugs/en-us/manual/authentication/manual/platform-signin-facebook.

    However, there is a workaround to setup a gaming type Facebook application.
    The app id must be registered with a `GG|` prefix. This only needs to be done in the identity provider setup for Unity Authentication (in the dashboard or editor settings). The configuration entry would look something like GG|1234567890.

    We haven't extensively tested this app type at this point.
     
    chengg_unity likes this.
  3. MtCarmelGames

    MtCarmelGames

    Joined:
    May 9, 2013
    Posts:
    5

    Thank you. How would I get the user's name? Is authentication just for persistence, then? And things like User name would be managed via my game?
     
  4. erickb_unity

    erickb_unity

    Unity Technologies

    Joined:
    Sep 1, 2021
    Posts:
    90
    For a display name, UGS has a unique player name solution if this is something you are interested in.
    The functionality is available through the Authentication SDK which you are using. (You may need to update your version)

    Documentation can be found here
    https://docs.unity.com/ugs/en-us/manual/authentication/manual/player-name-management

    You can also use cloud save to persist any data you want to be able to retrieve across devices, installs and players.