Search Unity

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

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:
    3
    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:
    3
    Never mind. I figured this myself) But your post gave me an idea how to solve it. Thanks anyway