AnsweredAssumed Answered

[Android] setCredentials for WMSLayer doesnt work in 100.7.0

Question asked by eliasz.kubala on May 5, 2020
Latest reply on Jun 16, 2020 by NFurness-esristaff


I am trying to load the Layer which is secured by a token. I have credentials to generate them and the URL.

I am using

UserCredential userCredential = new UserCredential(user, pass, tokenUrl)
ArcGISMapImageLayer dynamicLayer = new ArcGISMapImageLayer(ms.getServiceUrl());

And I am getting as response: 401 Unauthorized. Token Require.

Lib doesn't even try to make a request, and generate token before loading layer. I checked it in Proxyman.

In previous (10.x) library I used

UserCredentials userCredentials = new UserCredentials();
userCredentials().setUserAccount(user, pass)
ArcGISFeatureLayer featureLayer = new ArcGISFeatureLayer(url, mode, userCredentials);

Lib made a call to {tokenUrl},
Then it was loading layer with parameter {token} in URL.

There is any possibility to fix this issue? Same situation with WMSLayer, ServiceFeatureTable, ArcGISMapImageLayer, ArcGISTiledLayer.