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.
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.
Prem,
I don't believe you need to include DOMAIN. Please try it without and let us know what happens.
Eric,
I have the exact same result without the Domain as well. I also tried DOMAIN\\Username just in case there was a need to escape the "\"
Thanks
Prem
Remember that a SSL intentionally limits who can access the website or data. You may need to change how you change the sharing preferences in the organization. Rather than having it Private, it may need to be shared to the group or organization with whom needs to have access to it.
I think you may be referencing ArcGIS Online? We are not using ArcGIS Online. The service is on your own ArcGIS Server.
HI Prem,
You can take a look at the "User credential online" sample that is under the Security category. Let me know if this works for you.
Regards,
Jen Trieu | Product Eng.
Jen,
Thank you for the pointer.
I tried accessing the service through the sample and that works. But I am still unable to get it to work using embedded credentials. How can I replicate what the UserCredentialsDialog is doing without actually showing the user the dialog?
Thanks again for your help,
Regards,
Prem
Prem, what version of Server/Portal are you trying to authenticate against?
ArcGIS Server 10.2.2.
We will be moving to 10.3 in the near future but do not have a timeline yet.
Prem-
Before you upgrade to 10.3, you may want to consider the known issue with accessing secure services at 10.3 Server with the Qt/QML APIs - Release notes for ArcGIS Runtime SDK 10.2.5 for Qt—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
For now, 10.2.2 should work. Can you please email me the service URL, and set up some temporary test credentials on the server for me to try and log in with?
Thanks,
Luke