Need support for both Meta Quest *and* Oculus Rift platforms for a single game
-
Hello! I'm making a VR game for Meta Quest and PCVR using Unity. I've run into a blocker during my implementation of Oculus authentication which prevents me from testing my game in the Unity editor.
My game has both a Meta Quest version (runs on the Quest 2, Quest 3, and Quest 3S) and a Rift version (runs on PCVR). It is the same game, but by design there are 2 App IDs - one for Quest and one for Rift. This is a common setup for any Quest VR game, and it is how the game must be set up on the Meta developer dashboard to support both Rift and Quest. Even studios that are only making a Quest version of their game still commonly set up a Rift version so that the entitlement check still passes when they test the game in the Unity Editor. See the attached pictures below, which shows the 2 apps set up in the Meta developer dashboard and how both App IDs get entered in the Unity project (for the same game).
Currently, the brainCloud portal only has 1 App ID and App Secret entry under the "Oculus" platform. This means that I must choose either the Quest or Rift App ID/Secret, but I can't put in both. I've decided to put in the Quest App ID/Secret in the brainCloud portal under the "Oculus" platform. This causes authentication to fail when testing in the Unity Editor because when running the game in the Unity Editor, the Oculus entitlement check/user proof logs into the Rift version of the game, not the Quest version, thus it generates a nonce for the Rift version of the game which gets passed into brainCloud and fails because brainCloud attempts to validate the Rift nonce with the Quest App ID.
I suggest the following updates to brainCloud:
- Leave the existing "Oculus" platform - this would be used for the Oculus Rift PCVR build of the game.
- Introduce a new platform: "Meta Quest" - this would be used for Meta Quest build of the game.
- In the Unity client library, the developer would then call
AuthenticateOculus
in the Unity Editor for a Windows PCVR Rift build, orAuthenticateMetaQuest
for a standalone Meta Quest build.
This would allow brainCloud auth to work properly when testing in the Unity Editor/Rift PCVR version of the game and the Meta Quest version of the game. Currently brainCloud auth fails for one or the other, because there is only one "Oculus" platform in the design portal. Note that if anyone has previously configured "Oculus" for their Meta Quest app, it should still work just fine if they leave it as-is. The introduction of a "Meta Quest" platform would be an additive update to the portal and client SDK to allow the user to authenticate with either the Meta Quest version of the app or the Oculus Rift version of the app depending on the runtime platform (PC Rift/Unity Editor or Standalone Meta Quest).
Happy to discuss any implications of this. Currently for me, brainCloud auth simply does not work in the Unity Editor due to this issue which makes things a pain to test since I actually have to create a Meta Quest build to run on device in order for brainCloud to work. I'm open to a near-term workaround if you have any suggestions, but I think brainCloud should be updated to properly support both a Meta Quest App ID and a Rift App ID for the same game, by introducing a "Meta Quest" platform while leaving "Oculus" there for Rift apps. Since the Meta APIs are essentially the same for both Quest and Rift, I don't believe this would break any backwards compatibility for people who have already entered their Quest App ID/Secret under "Oculus".
-
Hi @MattForemanDev ,
Thank-you for the very detailed explanation of your situation. We'll review it with the devs.
Question - do you know if the id used to identify end-users is the same across both devices? i.e. I'm assuming that ideally, if someone logs into the game via Quest - and then later Rift - you'd want them both accessing the same account - with the same player progress, etc. - right?
Paul.
-
@Paul-Winterhalder Thanks for your response. Yes, if a user logs into the game via Quest, then later Rift, I'd want them both accessing the same account. I've dug into the User ID situation for Rift and Quest and have found some interesting information:
- The ID returned via
Oculus.Platform.Users.GetLoggedInUser()
is a unique user ID per application meaning one user's Meta account will have a different user ID for the Rift version of the app and the Quest version of the app, even if it's for the same game. I've verified this in my testing. However: - There is also an organization-scoped ID, which is consistent between apps (so it would be the same for both the Quest and Rift build). On the client this can be retrieved via
Oculus.Platform.Users.GetOrgScopedID()
, and on the backend the org-scoped ID can be retrieved using Meta's S2S API.
Here is where you can find information about these two types of IDs. Look under
GetLoggedInUser()
andGetOrgScopedID()
.So, the organization-scoped ID is what should be used in the backend to identify a single user across both a Rift version and a Quest version of the same app. Here is more information about that (look under "Retrieve a Verified Org Scoped ID").
It appears that the proper way for brainCloud to identify a single user across both a Rift app and Quest app is to first validate the nonce/token (as you already do) and then use Meta's S2S API to retrieve the user's org-scoped ID, and use the org-scoped ID to track the user, NOT the regular app-scoped user ID (which would be different on Rift and Quest). Does brainCloud already do this?
- The ID returned via
-
@Paul-Winterhalder I checked in the brainCloud portal in the User Browser and confirmed that brainCloud currently tracks Oculus users via the app-scoped user ID and does not do the additional step to get the org-scoped ID. I believe this may actually be an incorrect implementation. After the user is validated, an additional Meta 2S2 call should be performed to get the org-scoped ID which is what should actually be used to track the user because this ID is consistent for one user's account across both a Rift and Quest version of an app (and the current app-scoped ID would be different on Rift and Quest for the same user's account).
So, if support for both Oculus Rift and Meta Quest is added, brainCloud's authentication logic would need to be updated to use the org-scoped user ID in order to identify the same user across the Oculus Rift PCVR version and the Meta Quest version of a game.
Happy to discuss this further with the developers if needed. It would be great to get this up and running properly.
-
Small update - I've found a workaround for getting the Unity Editor to properly authenticate brainCloud with the Meta Quest version of the app (however an actual PCVR Rift build still does not work). In the Meta dashboard I created a "test user" under the Quest version of my app, and in the Unity Editor's "Oculus Platform Settings" there is a checkbox to "Use Standalone Platform" which allows you to input test user credentials for the Meta Quest version of the game (see attached picture below). This apparently allows the Meta entitlement check/nonce to be associated with the Meta Quest app ID - only in the Unity Editor, not in an actual PCVR Rift build.
So, this appears to be a workaround to get brainCloud auth to working in the Unity Editor for the Quest version of the app by using a "test user". Note that this is not a fix for getting the Rift version of the app to work with brainCloud auth alongside the Quest version. It is simply a workaround for the Unity Editor only.
-
Cool. Thanks for the update @MattForemanDev !