laptop and a wrench

Bug

The RouteTask.setCredential method is not applying the credential to service requests.

Last Published: September 20, 2019 ArcGIS Runtime SDK
Bug ID Number BUG-000124688
SubmittedAugust 21, 2019
Last ModifiedJune 11, 2022
Applies toArcGIS Runtime SDK
Version found100.5
Operating SystemApple iOS
Operating System VersionN/A
StatusIn Product Plan

Workaround

Use one of the following workarounds:

  • Set a UserCredential that is constructed from username and password like the following on the RouteTask.

UserCredential credential = new UserCredential(“your username”, “your password”);

  • Use the AuthenticationManager.CredentialCache.restoreFromJson method to apply token for the service https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/security/AuthenticationManager.CredentialCache.html#restoreFromJson(java.lang.String).

e.g.

AuthenticationManager.CredentialCache.restoreFromJson("[{\"serverContext\":\"route.arcgis.com/arcgis\",\"credential\":\"{\\\"password\\\":\\\"\\\",\\\"token\\\":{\\\"expires\\\":9223372036854775807,\\\"ssl\\\":true,\\\"token\\\":\\\" <token> \\\"},\\\"username\\\":\\\"\\\"}\"}]");

Steps to Reproduce

Bug ID: BUG-000124688

Software:

  • ArcGIS Runtime SDK

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options