Adding Secure Service with Credentials stored in item

3442
2
05-03-2016 07:23 AM
TravisButcher
Esri Contributor

I am trying to add a Map Service for ArcGIS Online into an application.  The service is stored in ArcGIS Online with the credentials as part of the service.  In this case I get the utility service URL to try and get the object.

https://utility.arcgis.com/usrsvcs/servers/4374389db5a14a7985ec39fb1b778408/rest/services/SFI/SFI_Hr.....

I am appending a ArcGIS Online Portal token I am getting from the service to allow this query.  I can copy and paste the above into a browser (the token times out in 30 minutes so likely no longer valid) but when I try to add to a QML app nothing is showing up. 

Any suggestions?  Ideas? !

Tags (2)
0 Kudos
2 Replies
LucasDanzinger
Esri Frequent Contributor

Try the following:

- Create a UserCredentials object with the username/password - ArcGIS Runtime SDK for Qt QML API: UserCredentials Class Reference

- Assign this object to your Layer's credential property - ArcGIS Runtime SDK for Qt QML API: Layer Class Reference 

0 Kudos
TravisButcher
Esri Contributor

Does this work with an ArcGIS online user?  We are using OAuth to get into ArcGIS online.

In reading the API Doc:  "Represents user credentials for accessing secured ArcGIS services and tasks"

I tried creating the UserCredentials with the Online credentials but that did not seem to be working either.

0 Kudos