accessing secured services

1963
2
Jump to solution
01-29-2012 08:49 AM
MichaelBlom
New Contributor III
Hi there,
i'm trying to access a service on a secured arcgis server like the example provided in the help:

  
 AGSCredential* cred = [[AGSCredential alloc] initWithUser:@"mydomain\myusername" password:@"mypassword"];                 //pass the credential to layer or task     AGSDynamicMapServiceLayer *thelayer = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:[NSURL URLWithString:@"https://myServer.com/ArcGIS/rest/services/DynamicLayerName/MapServer"] credential:cred ];           [self.myMapView addMapLayer:thelayer withName:@"Layer Name"];


results in this error...
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn???t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x81c6430
NSErrorFailingURLKey=https://myServer.com/ArcGIS/rest/services/DynamicLayerName/MapServer?f=json

I can browse to this service in a browser with these credentials, and view the service and its layers.
One thing of note, I have not set any security on the arcgis server, my security is set via IIS as basic with https.  Is it the case that my AGSCredential can't be used for basic https authentication??

Thanks,
Mike
0 Kudos
1 Solution

Accepted Solutions
MichaelBlom
New Contributor III
argh, solved it:

replaced:
@"mydomain\myaccount"

with:
@"mydomain\\myaccount"

View solution in original post

0 Kudos
2 Replies
MichaelBlom
New Contributor III
I've also tried to create my credentials with a third parameter:   authenticationType:AGSAuthenticationTypeHTTP]

but no luck.

also, I know that my cert is authorised -  previously I had pointed to a dynamicfeaturelayer service on my dev server whose certificate isn't authorised, and i was getting errors that pointed to this, so now i'm referencing services on my prod arcgis server, which does have trusted certs (i.e. I don't get prompted with a "certificate is untrusted" warning), but I still can't pull my dynamicfeaturelayer into my map.
0 Kudos
MichaelBlom
New Contributor III
argh, solved it:

replaced:
@"mydomain\myaccount"

with:
@"mydomain\\myaccount"

View solution in original post

0 Kudos