We took a different approach to a similar problem, as we had to redirect to HTTP. We authenticated with cookies and set them for the whole domain:
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys: kAuthCookieDomain, NSHTTPCookieDomain, kAuthCookiePath, NSHTTPCookiePath, kAuthCookieName, NSHTTPCookieName, kAuthCookieValue, NSHTTPCookieValue, kAuthCookieDiscard, NSHTTPCookieDiscard, nil]; NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:properties]; [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
Daniel Bauke
source share