Hello, I am trying to use the new Oculus sign in capabilities of the Authentication package by using the example script provided for Oculus SignIn, however I get the next error when I try to use : AuthenticationService.Instance.SignInWithOculusAsync(oculusNonce, userId);
Project Information :
Unity 2021.3.15f1
Authentication 2.3.1
I still having trouble getting this to work. I still ge tRequest failed: 401, {“title”:“PERMISSION_DENIED”,“detail”:“unable to validate token”,“details”:[ ],“status”:401}
I verified:
app id and secret are correct
Data use checkup is done
I pass the entitlments check with my developer account
And still when i use the SignInWithOculusAsync it refuses me. Getting desperate here
Edit: Just noticed when i set my details in the editor i get the same error
I just upgraded to Unity 2021.3.21 (macOS) and am now getting this error on device, but the exact same code worked when using 2021.3.18. Also worth noting that when I rollback, I have to revert any automatic changes (packages.json etc) that upgrading to 2021.3.21 did, otherwise the error persists.
We had the same problem and managed to find out why.
Unity 2021.3.21 fixes a problem where, if you upgraded before from Unity 2020.3, your code stripping level was changed to a lower value than expected. When upgrading our project from 2021.3.9f1 to 2021.3.21f1, this actually caused our code stripping to go up (!) from minimal to low.
This is the entry in the changelog:
IL2CPP: Projects created prior to 2021.3 and opened in 2021.3 or newer could have their Managed Stripping Level incorrectly migrated to the new default value of Minimal when the old default of Low should have been retained. (UUM-19512)
The issue with Oculus authentication is caused by code stripping. You can fix it by changing back to Minimal code stripping, or by adding a link.xml file in your project with this content:
I’m having the same issue as LittleDreamerGames. Everything is exactly as he described and I am on version 2021.3.28f1 for the Unity Editor and 3.2.0 for Authentication service.
I still get the 401 unable to validate token error.
The other weird issue is that when I try it in a build I don’t get any error at all in the adb logs, instead Oculus’ Users.GetUserProof().OnComplete callback never gets called (I put a debug log in it that never prints). But in the editor the callback is called perfectly and I get the correct userId and a seemingly valid Nonse but then I get the 401 error.
I am at a loss here… Anyone have any ideas or suggestions?
The problem was that I was using msg.Data.OculusID instead of msg.Data.ID to sign in using AuthenticationService.Instance.SignInWithOculusAsync method.
This is stated in a comment in unity’s documentation here, although it’s not very obvious and easy to miss…
Also, make sure that everything mentioned by LittleDreamerGames above is correct as well.
Turns out the final bug where the Complete callback was not getting called was because I was calling it from a separate thread. It seems that Users.GetUserProof() must be called from the main Unity thread otherwise the Complete callback will not fire in a build.
Also, since you can only set 1 oculus provider in the authentication tab under services in project settings, you have to SignInAnonymously() while in editor. This setting is save in the Unity Cloud so it is not local to the branch you are working on which means you cannot switch between rift and quest app without affecting all users (in editor and in builds). So the solution is to have anonymous UGS users when testing in the editor and just link/sign them in when in a build.
Guys I’ve been struggling for months with this, it turned out that, in my case, I just needed to signout → signin my account on the PC Oculus app. Looks like the token generated on the initial sign in, needs to be refreshed after granting UserId feature on the Oculus dashboard.
I need to do this each time I create an Oculus app.
Hey guys, I am having issues with this as well. I am using the new workflow from Authentication 3.3.3 on meta quest with a nonce and it works mostly all the time, but intermittently, a user will receive a 401 error. What should I do in this case ? I could implement a retry but if it keeps failing I’m not sure how to handle it.