ArcGIS credential dialog pops up occasionally on loading AGSSyncTask...

734
16
Jump to solution
10-04-2021 09:10 PM
ShiminCai
Occasional Contributor III

Hi there,

I'm loading layers in a feature service to map using AGSGeodatabaseSyncTask. The feature service is not secured. Everything works just fine but occasionally not always though, the ArcGIS credential dialog appears on loading the syncTask as shown in the attached image. Once the dialog is out I can't skip or sign in as the sign in button is greyed out. The only way out is to kill the app...

 

let gdbSyncTask = AGSGeodatabaseSyncTask(url: url)

gdbSyncTask.load { (error) -> Void in

    ... loading layers to the map after gdbSyncTask loaded without error...

}

 

I tried to set the gdbSyncTask.credential property with a valid credential of username and password but the dialog still pops up randomly. How can I stop it popping up?

Thanks,

 Shimin

 

0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor

Hi Shimin,

 

Thank you for the new log file. I analyzed the log file and particularly the HTTP responses and response headers. Based on that looks like your server setup has load balancer. The responses with response header Server = "" are working fine and responses which has Server = "awselb/2.0" are responding the HTTP status code 403. The response code 403 is considered as an authentication error and we prompt for the credential. You will have to figure out why that server responds with HTTP status code 403.

 

Regards,

Nimesh

View solution in original post

0 Kudos
16 Replies
ShiminCai
Occasional Contributor III

Further to the mix: the first time and second time load of gdbSyncTask are ok, but on the third time the load method gets an error of "Request Forbidden" in the completion block. Thanks.

0 Kudos
NimeshJarecha
Esri Regular Contributor

Hi Shimin,

If possible, can you please send us the reproducible code and all request/response log so we can investigate what is going on?

 

Regards,

Nimesh

0 Kudos
ShiminCai
Occasional Contributor III

Hi Nimesh,

I created a reproducible Xcode project which is about 400 mb after zip. How can I send it to you?

Thanks,

Shimin

0 Kudos
NimeshJarecha
Esri Regular Contributor

Hi Shimin,

I've direct message with instruction to send me the project. Thank you!

Regards,

Nimesh

0 Kudos
ShiminCai
Occasional Contributor III

Hi Nimesh,

Have uploaded the files to the site as instructed.

However, the uploading failed many times due to a hung Ajax request. Looked like the following uploads were appending to the previous failed uploads. If the file is somehow corrupted please provide a mailbox I'll send a Dropbox link to download from Dropbox.

Thanks a lot for your help.

Cheers,

Shimin

0 Kudos
NimeshJarecha
Esri Regular Contributor

Hi Shimin,

I was able to download the project and run. However, is feature service used in the project internal? When I try even in browser it gives me `403 Forbidden` error. See attached image. 

 

Regards,

Nimesh

 

Screen Shot 2021-10-08 at 9.52.38 AM.png

0 Kudos
ShiminCai
Occasional Contributor III

Hi Nimesh,

Sorry the feature service was behind a geoblocking. The geoblocking has now been disabled temporarily. Could you please have another go?

Thanks,

Shimin

 

0 Kudos
NimeshJarecha
Esri Regular Contributor

Hi Shimin,

Thank you, I'm able to access the feature service now. Using your repro project, I tried to reproduce the issue multiple times but not able to do so. There are lot of layers in the feature service so it takes some time for them load and render on the map but no credential dialog pops up.

I suspect your geoblocking is playing part in credential dialog? The `403` errors are considered an authentication and somehow your geoblocking coming into picture and throws `403` error and credential dialog pops up.

Are you still able to reproduce the issue?

 

Regards,

Nimesh

0 Kudos
ShiminCai
Occasional Contributor III

Hi Nimesh,

Yes I'm still able to reproduce the issue with the same repro project. Loading layers is ok first time tapping the Load Feature Layers button. As soon as the layers are fully loaded, tapping the button second time the credential dialog box pops up. Please see the attached images.

Thank you for your help.

Regards,

Shimin

0 Kudos