google-ar / arcore-unity-extensions

Google ARCore Extensions and Geospatial Creator for Unity's AR Foundation
Other
354 stars 96 forks source link

iOS token auth: EarthState ErrorNotAuthorized #87

Open Barokoli opened 2 years ago

Barokoli commented 2 years ago

I am not able to get EarthTracking running with token authentication on iOS in our project. On Android it works with the same code/project. I am using token authentication and persistent cloud anchors are possible to be loaded. I am using the new ARCore API Endpoint and i can also see the requests coming through. (The old API is still active to allow backwards compatibility) I am on version 1.33 and checked that all pods are correctly installed. Geospatial is enabled in the Extension Settings. Our JWT token generated uses the new audience "https://arcorecloudanchor.googleapis.com/". I also tried API Key authentication and i get the same error whilst no longer being able to load persistent cloud anchors (as expected).

I am not sure about this but: If I use API Key authentication the "google.geo.ar.v1.LocalizeService.StartSession" gets called as i can see by the API/Service Details (with an error)Edit: API Key Authentication works, i had api restrictions on that key and not the new ARCore API added. We can't switch to API Key authentication since we need persistent cloud anchors. If I use token authentication the "google.geo.ar.v1.LocalizeService.StartSession" does not seem to get called If I use android the method is called successfully

Do you have any ideas how to investigate this further? Any help is appreciated!

voropserg commented 2 years ago

Did you manage to solve this issue ? I'm not able to host/resolve persistant anchors using the token authentication on IOS. Could it be something to do with the Console project configuration ?

Barokoli commented 2 years ago

I haven't been able to use the Geospatial system successfully with iOS token auth yet. I still get the EarthState ErrorNotAuthorized. However I can use persistent cloud anchors with v.1.33. I will write my experiences in your thread.

Regarding Earthtracking with iOS Token auth I still hope for some tips. -I am also interested if anyone got it running

horni98 commented 1 year ago

Hey, any updates on this one? Did anyone manage to solve this issue?

Barokoli commented 1 year ago

With the help of @devbridie I found a workaround. If the auth token is set before creating the ARSession it works. If set afterwards it works only with persistent cloud anchors.