Just out of curiosity, could you use the AGSCredential class instead of manually asking for the token?AGSCredential *myCredential = [[AGSCredential alloc] initWithUser:[jsonDict objectForKey:@"username"] password:[jsonDict objectForKey:@"password"] authenticationType:AGSAuthenticationTypeToken tokenUrl:url];
You can access the token provided here using:myCredential.token;
I believe all the AGS classes that are used to access services that may or may not be secured have a "credential:" optional argument. So in this case if you wanted to get information about a secured map service you'd do this:NSError *serviceError = nil;
AGSMapServiceInfo *serviceInfo = [[AGSMapServiceInfo alloc] initWithURL:mapServiceEndpoint credential:myCredential error:&serviceError];
I know this wasn't exactly what you were asking, but hope it helps.Chris