Connect to a secure map service?

929
1
11-29-2010 01:40 AM
TigerLeung
New Contributor II
hey all,

I used AGSCredential in creating a layer for a secure map service. My token service is running with my self-signed certificate. I am sure the username and the password are correct. Here is my code.

AGSCredential *userCredential = [[AGSCredential alloc] initWithUser:userName 
           password:passcode 
       authenticationType:AGSAuthenticationTypeToken 
           tokenUrl:[NSURL URLWithString:kAGSTokenServiceURL]];

dynamicLayer = [[[AGSDynamicMapServiceLayer alloc] initWithURL:[NSURL URLWithString:dynamicMapService.serviceURL] credential:userCredential] autorelease];



But I kept getting an error "Unauthorized Access". Unfortunately, I am not sure how to find out some useful information from NSError.

Has anybody tried AGSCredential with a secure service? Please help.


thanks,
0 Kudos
1 Reply
TigerLeung
New Contributor II
I just saw the article on the Resource Center, saying "Self-signed certificates are not supported. Use certificates issued by a trusted certificate authority.".

My question is more general: How to find out the information from NSError?
0 Kudos