Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug Authentication with Apple Game Center causes error 401

Discussion in 'Authentication' started by stipe1995, Aug 11, 2023.

  1. stipe1995

    stipe1995

    Joined:
    Oct 24, 2016
    Posts:
    2
    Hello!

    I am trying to use the Authentication package with Apple Game Center in capabilities, but I get error "Request failed: 401". It happends when I use "LinkWithAppleGameCenterAsync" or "SignInWithAppleGameCenterAsync".
    Please note that AppleGameCenter login works. I checked multiple times and Bundle ID in provider details is definitely correct!

    Project Information :
    Unity 2022.3.6f1
    Authentication 2.7.2

    [Authentication]: Request failed: 401, {"title":"PERMISSION_DENIED","detail":"unable to validate token","details":[],"status":401}


    EDIT:
    When calling "LinkWithAppleGameCenterAsync" or "SignInWithAppleGameCenterAsync" I had two parameters switched wrong way. And thats why you should go to sleep and not work at 1AM.
    Anyways I have GameCenter fully working now, If someone else has any problems with it, feel free to contact me.
     
    Last edited: Aug 11, 2023
  2. Artorias_Abyss

    Artorias_Abyss

    Joined:
    Oct 1, 2021
    Posts:
    5
    Good day, sir! How did you figure this out? I have the same error, but with LinkWithFacebookAsync.
    if (FB.IsLoggedIn)
    {
    Token = AccessToken.CurrentAccessToken.TokenString;
    Debug.Log($"Facebook Login token: {Token}");
    }
    I try to post this token from Facebook and getting the same 401 error
     
  3. Artorias_Abyss

    Artorias_Abyss

    Joined:
    Oct 1, 2021
    Posts:
    5
    Never mind. I figured this myself) But your post gave me an idea how to solve it. Thanks anyway