oculus-samples / Unity-SharedSpatialAnchors

Unity-SharedSpatialAnchors was built to demonstrate how to use the Shared Spatial Anchors API, available in the Meta XR Core SDK for the Unity game engine.
MIT License
119 stars 45 forks source link

You are not authenticated to use this app #13

Closed lucaremberg closed 1 year ago

lucaremberg commented 1 year ago

Hey, I`ve getting the message that i am not authenticated to use the app, when i am trying to start one of the modes. do you know how to fix this? https://imgur.com/EU9sxd9 //Screenshot, what i am getting in the app

lucaremberg commented 1 year ago

https://developer.oculus.com/documentation/unity/unity-ssa-sf/ was a little frustratig finding the documantation after posting this. i am sorry 😅

jmschrack commented 1 year ago

@lucaremberg What did you do to fix it? I'm getting the same error as you.
As far as I can tell, I followed the documentation's project setup exactly, I have the AppID, Photon ID, and I'm approved for User ID and User Profile.

lucaremberg commented 1 year ago

@jmschrack did you add the photon stuff into the Highlight Server Settings? and did you generate a new android manifest?

jmschrack commented 1 year ago

@lucaremberg Yes to both. The sample will connect to the PUN server, but sharing spatial anchors fails. The specific error is that the User ID from meta Platform is returning as "0"

I'm going to give it 24hours, maybe something on Meta's side needs to update. (I confirmed that I am approved for UserID and UserProfile on the developer dashboard)

Dariushuangg commented 1 year ago

Hello, I have the exact same issue after going through the exact same procedure as @jmschrack . I made sure:

  1. Photon appID is set
  2. Oculus appID is set for both Quest and Rift
  3. Enabled user ID and user profile in Data check up in Oculus dashboard and both are approved.
  4. Two devices are using two different accounts. I still see the log "You are not authenticated to use this app", and while I can create spatial anchor and sharing it says "anchor successfully saved to the cloud (though the callback is -1001)", the other player can't see the anchor even though they are in the same room.
jmschrack commented 1 year ago

I figured out the missing steps! It seems that if your app is not public, the UserID Platform API will only authenticate specific users. My account is an administrator on our org.... but it wouldn't authenticate until I specifically added myself as a ALPHA channel user.

  1. Create a custom keystore for your app (Project Settings > Player > Publishing)
  2. Build an APK, and upload it to the ALPHA channel on your Developer Dashboard for the app.
  3. On the ALPHA channel page, add yourself as a User
  4. To verify it works, go to the app store on your quest and search the exact name of your app. You should be able to install it from there. You will now authenticate successfully!

You do not have to re-upload to the ALPHA channel every time. As long as you're using the same keystore and incrementing the version number, you can make new builds and sideload from Unity directly to the Quest and the UserID will continue to work.

@Dariushuangg In your case, you'll need to add both accounts to the ALPHA channel user list

Dariushuangg commented 1 year ago

Thank you so much for @jmschrack 's detailed instruction. The "You are not authenticated to use this app" log is now gone after uploading to alpha channel and adding accounts to user list; The log now shows correct user ID of my accounts. However, I still can't see any visual anchors created by the other player in the "Anchor Sharing Demo". I can't find any log that indicate some kind of failure on the panel either. I am wondering are you @jmschrack experiencing this? What do you see in the Anchor Sharing Demo scene? Thanks.

jmschrack commented 1 year ago

@Dariushuangg I'm having similar results. What i discovered is that if player 2 puts a cube directly in front of them (which is in front of player 1), player 1 will see the cube appearing 10ft above them and 5 feet off to the side! Similarly strange offsets going the other way.

But I think that's a bug for a different ticket, and not related to the authentication problem.

Dariushuangg commented 1 year ago

You are right and this is also what I saw. Thanks!

stephenm2022 commented 1 year ago

I figured out the missing steps! It seems that if your app is not public, the UserID Platform API will only authenticate specific users. My account is an administrator on our org.... but it wouldn't authenticate until I specifically added myself as a ALPHA channel user.

  1. Create a custom keystore for your app (Project Settings > Player > Publishing)
  2. Build an APK, and upload it to the ALPHA channel on your Developer Dashboard for the app.
  3. On the ALPHA channel page, add yourself as a User
  4. To verify it works, go to the app store on your quest and search the exact name of your app. You should be able to install it from there. You will now authenticate successfully!

You do not have to re-upload to the ALPHA channel every time. As long as you're using the same keystore and incrementing the version number, you can make new builds and sideload from Unity directly to the Quest and the UserID will continue to work.

@Dariushuangg In your case, you'll need to add both accounts to the ALPHA channel user list

Hi @jmschrack. Thanks for posting the fix. I will add these steps to the documentation.

stephenm2022 commented 1 year ago

Thank you so much for @jmschrack 's detailed instruction. The "You are not authenticated to use this app" log is now gone after uploading to alpha channel and adding accounts to user list; The log now shows correct user ID of my accounts. However, I still can't see any visual anchors created by the other player in the "Anchor Sharing Demo". I can't find any log that indicate some kind of failure on the panel either. I am wondering are you @jmschrack experiencing this? What do you see in the Anchor Sharing Demo scene? Thanks.

Hi @Dariushuangg. Make sure you press the share anchor button on the anchor's UI after creating it.

The logs should indicate success or failure after sharing: Successfully saved anchor(s) to the cloud OnShareComplete Result: Success

For receiving users you should see: RetrieveAnchorsFromCloud OnLoadUnboundAnchorComplete BindAnchorsCoroutine Binding Anchor... Anchor created and bound to cloud anchor

stephenm2022 commented 1 year ago

@Dariushuangg I'm having similar results. What i discovered is that if player 2 puts a cube directly in front of them (which is in front of player 1), player 1 will see the cube appearing 10ft above them and 5 feet off to the side! Similarly strange offsets going the other way.

But I think that's a bug for a different ticket, and not related to the authentication problem.

Hi @jmschrack. Make sure you create and share an anchor from 1 of the devices. Then align to that anchor on both devices. After aligning to the same anchor, new cubes will appear in the same orientation for both devices.

jmschrack commented 1 year ago

@stephenm2022 The issue i'm running into is that the anchor will be extremely offset as well, appearing in a position that is physically impossible for the other person to reach. Similar effects happen if i choose "Automatic Colocation". The forest scene will load in, but I'll see the other person's avatar clipping through the floor, and they'll see my avatar up in the sky.

I'll try and record footage of it later.

stephenm2022 commented 1 year ago

@stephenm2022 The issue i'm running into is that the anchor will be extremely offset as well, appearing in a position that is physically impossible for the other person to reach. Similar effects happen if i choose "Automatic Colocation". The forest scene will load in, but I'll see the other person's avatar clipping through the floor, and they'll see my avatar up in the sky.

I'll try and record footage of it later.

Thanks @jmschrack! Since this is a different issue, please open a new issue and include the session logs and recording. I'm going to close this issue since it has been resolved.