With NSURLRequest / NSMutableURLRequest, you can configure authentication using any method you like ... here is an example of HTTP Basic to get some XML result.
NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"GET"]; // or POST or whatever [request setValue:@"application/xml" forHTTPHeaderField:@"Accept"]; NSString * userID = @"hello"; NSString * password = @"world"; NSString * authStr = [[[NSString stringWithFormat:@"%@:%@", userID, password] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding]; [request setValue:[NSString stringWithFormat: @"Basic %@", authStr] forHTTPHeaderField:@"Authorization"];
You will need to read HTTP authentication methods to know what to do to talk to your specific server, but there is nothing wrong with using HTTPS (SSL) + Basic, it is safe.
source share