I am trying to add a secure FeatureService layer to my map, eventually I also want to take the data offline for editing as well. I am unable to do this using embedded usercredentials as below. I have double checked and triple checked the credentials and it works in other places just not here.
GeodatabaseFeatureServiceTable {
id: featureServiceTable
url: "http://domain.com/service/FeatureServer/0" // replacing with dummy layer
credentials: userCredentials
}
UserCredentials {
id: userCredentials
userName: "DOMAIN\USERNAME"
password: "PASSWORD"
}
In my Map I have
FeatureLayer {
id:featurelayer
featureTable: featureSErviceTable
// also tried to use credentials: userCredentials here.
}
The error log is
ArcGIS.Runtime.Feature: void __cdecl QmlFeatureTable::onInitializeComplete(const class QString &) EsriRuntimeQt::GeodatabaseFeatureServiceTable(0x1c7913c1e0)
ArcGIS.Runtime.Layer: void __cdecl QmlLayer::onLayerCreateError(const class QString &) QmlFeatureLayer_QML_52 "" "You are not authorized to access this information"
Solved! Go to Solution.
Hi Prem,
You just need to change the following:
UserCredentials {
id: userCredentials
userName: "DOMAIN\USERNAME"
password: "PASSWORD"
}
Connections {
target: ArcGISRuntime.identityManager
onUserCredentialsRequired: {
loadButton.enabled = true;
dynamicRadioButton.enabled = true;
credentials.userName = userCredentials.userName;
credentials.password = userCredentials.password;
loadButton.enabled = false;
dynamicRadioButton.enabled = false;
}
}
Regards,
Jen Trieu | Product Eng.
Jeanne Trieu I tried this and got the same result.
Lucas Danzinger I emailed you the feature service with a username and password.
Thank you for all the help .
This was a bug with the identity manager. It will be fixed in the 10.2.6 release of the SDK, which will be out shortly. The workaround is to directly set the user credentials on the service table instead of using the identity manager.