Unable to Validate Token For Unity Player Accounts

I tried to run LinkWithUnityAsync() with my Anonymous AccessToken and ever time i try to link I get a 401 back with the following error:

WebRequestException: {“title”:“PERMISSION_DENIED”,“detail”:“unable to validate token”,“details”:[ ],“status”:401}

Where do you get the access token from? You need to get it from PlayerAccountsService.Instance.AccessToken. Are you maybe using the Session Token?

Hello,

As MiTschMR suggested, the input for LinkWithUnityAsync needs to be the PlayerAccountsService.Instance.AccessToken value. I was able to track down the cause of the error and I suspect that the access token provided was from the AuthenticationService instance instead of the PlayerAccountsService instance. Hope this helps!

Ah thank you so much. I didn’t have the PlayerAccountsService preview package installed, and was using AuthenticationService instead.

2 Likes