AGSJSONRequestOperation with AGSCredential

Discussion created by allenbrunson on Dec 5, 2013
Latest reply on Jul 8, 2016 by Yue_Wu-esristaff
I am building an iOS app with the ArcGIS 10.2 SDK. I've gotten a lot of stuff implemented over the last few months. This part is stumping me, though.

Our ArcGIS server has some protected endpoints I want to get to with AGSJSONRequestOperation. So I create one of those, and attach an AGSCredential object to it, which is using AGSAuthenticationTypeToken. Alas, the server always returns an error, telling me that my "token is invalid or expired."

I've successfully used AGSJSONRequestOperation before, for unprotected endpoints. I've also successfully used AGSCredential objects, for logging in, doing queries with AGSQueryTask, getting information with AGSGeoprocessor, and so on, all with the AGSAuthenticationTypeToken auth type. But I am not able to use these two objects together.

Do any of your example projects access protected endpoints with AGSJSONRequestOperation? If so, I'm sure I could follow that.