Anybody know how to handle authentication in the 2.0 version of AFNetworking? I tried the below without success. The block is getting called (I had an NSLog in there) but the response is still a 401 error
[self setTaskDidReceiveAuthenticationChallengeBlock:^NSURLSessionAuthChallengeDisposition(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential *__autoreleasing *credential) {
*credential = [[NSURLCredential alloc] initWithUser:username password:password persistence:NSURLCredentialPersistenceForSession];
return NSURLSessionAuthChallengeUseCredential;
}];
credential
property on your AFHTTPRequestOperation object? – Collegiate