Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Unity [Authentication]: Token has expired.

Discussion in 'Authentication' started by ChihiroOhsato, Jul 21, 2022.

  1. ChihiroOhsato

    ChihiroOhsato

    Joined:
    Mar 28, 2022
    Posts:
    1
    Environment
    - Unity2021.3.6f1
    - Android version Q (10)

    I am trying to do an anonymous login using "com.unity.services.authentication": "2.1.1" in Unity
    I tried to write and build the code for anonymous login based on the documentation, and it succeeded in logging in on IOS, but failed in logging in on android.

    I asked someone else to try it on their Android, and it seemed to occur on some devices even with Android version 12 (some devices did not have it).
    Terminals with this problem keep giving the same error and cannot log in, while terminals without this problem are able to log in.

    I was debugging to solve this problem and found this error together
    Hope this helps to resolve the issue.


    Error Unity RequestFailedException: Failed to decode and verify access token.
    ErrorCode:0 (I let this line output itself.)



    Error ResolverController No valid NAT64 prefix (133, <unspecified>/0)
     
    Dr_Shtenzel likes this.
  2. HerrPascal

    HerrPascal

    Joined:
    Apr 29, 2020
    Posts:
    7
    I have kinda the same issue on iOS. I got the iOS idtoken of the user but if I try to feed it into the '
    SignInWithAppleAsync' method i get the exact same error. Were you ever able to fix the issue?
     
  3. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    186
    The same random error in my app.
     
  4. Dknighter2

    Dknighter2

    Joined:
    Aug 17, 2014
    Posts:
    39
    We're also getting this with Phasmophobia on PC. We don't have many players with the issue however for people with it a VPN does not help.
     
  5. ItsNoxL

    ItsNoxL

    Joined:
    Dec 13, 2020
    Posts:
    3
    I'm also running into this issue. The weird thing is that it's completely fine on my machine, but when I send a build of the game to my friend, he gets an "Authentication token expired" error even though we're both on the same version of windows 10. I have no idea how to fix it (maybe it's a bug and we just need to wait until it gets fixed)
     
    Last edited: Dec 23, 2022
  6. unity_D4A6C01F3EBB83613B4D

    unity_D4A6C01F3EBB83613B4D

    Joined:
    Oct 19, 2022
    Posts:
    5
    Got the same problem now. It works weff for the whole team excepts for 1 person.

    Edit:
    Make sure to "sync" the time in windows. the problem was time being 20s into the future
     
    Last edited: Jan 13, 2023
  7. Dknighter2

    Dknighter2

    Joined:
    Aug 17, 2014
    Posts:
    39
    Hey, we've got this figured out now. Unity check the system clock on the players PC to see if it is within 1 hour of when the steam auth token was given. So if the players PC is set to the wrong time then it will give token expired. The only fix is to make them set their PC date to automatic.
     
  8. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    186
    This makes sense.