Hello,
I'm trying to use the ServiceFeatureTable to display a track on the map, but before the request is served, it needs to be authenticated by an intermediate server. I'm passing the authentication token to the ServiceFeatureTable's credential class, but I'm getting the following error:
com.esri.arcgisruntime.io.HttpResponseException: status code: 404, reason phrase: Page not found.
It seems that the error is related to the "referer" value, which is mandatory, but I don't know what to pass for it. I cannot pass null or an empty value. Here is my implementation:
// Get the service URL from the getTracksUseCase
val serviceUrl = "service_url"
val authToken = "auth_token"
val serviceFeatureTable = ServiceFeatureTable(serviceUrl)
// Pass the auth token to authenticate the request
val credential = UserCredential.createFromToken(
authToken,
"referer"
)
serviceFeatureTable.credential = credential
trackFeatureLayer = FeatureLayer(serviceFeatureTable).apply {
id = "user_track_map"
mapView?.map?.operationalLayers?.add(this)
loadAsync()
addDoneLoadingListener {
if (loadStatus == LoadStatus.LOADED) {
mapView?.setViewpointAsync(Viewpoint(fullExtent))
completionCallback?.onSuccess(visible)
} else {
completionCallback?.onError(loadError)
}
}
}
However, the iOS SDK version we are using allows passing a null value for the referer, and it works without any issues.
Can you guys help me to pass the authentication token to our server as the iOS SDK allows? The version of ArcGIS runtime SDK we are using is 100.15.0 for Kotlin..
The documentation for the iOS class can be found at the following link:
https://developers.arcgis.com/ios/api-reference/interface_a_g_s_credential.html