AGSQueryTask  Secure Service Problem

01-13-2011 04:59 AM
New Contributor III
We are trying to access a secure REST Layer with AGSQueryTask
the token URL works fine from the browser and the server Certificate is signed from a third party authority.

We are using the following credential to initialize the AGSQueryTask.

AGSCredential *cred = [[[AGSCredential alloc] initWithUser:@"user123"
              tokenUrl:[NSURL URLWithString:@"https://serverdomain/ArcGIS/tokens/"]] autorelease];

Every query fails  with error.

Error Domain=NSCocoaErrorDomain Code=498 "Invalid token" UserInfo=0x4d90830 {NSLocalizedFailureReason=, NSURL=http://serverdomain/ArcGIS/rest/services/kallikratis/MapServer/0/query?spatialRel=esriSpatialRelInte...             114365750ken22Efag3e0IUOMsoV5Rdg-gCikwvNAhBCp-mz2cPaIY7vlEBWUhOdvOoDWWF6Njsc2222expires2222-1073750072&f=json, NSLocalizedDescription=Invalid token}

Please help.
0 Kudos
1 Reply
Esri Regular Contributor
Looking at the error, I see that a token was acquired successfully by the Query Task. But it was rejected by the server when the token was used to invoke a Query operation.

Could you double check that the service the Query task is using permits access to user123?
0 Kudos