1

I am using SDWebImage in iOS with http digest authentication. As expected I get 401 Unauthorized error the first time the request is made, but I am not sure how to read WWW-Authenticate response header (and get the nonce/realm etc.) so that I can resend the request with supplied nonce (to prevent replay attacks).

    SDWebImageDownloader *downloader = [SDWebImageManager sharedManager].imageDownloader;
[downloader setValue:email forHTTPHeaderField:@"X-Oauth-Username"];
// set other headers here ...
// QUESTION: no way to get the response headers ??

[SDWebImageDownloader.sharedDownloader downloadImageWithURL:imageUrl options:0
        progress:^(NSInteger receivedSize, NSInteger expectedSize) {
            // progression tracking code
        }
        completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {
            callback(encodedUrl, image);
        }
];

Or, SDWebImage doesn't support HTTP Digest Authentication ? If so, are there any alternate framework which can handle this ?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.