HTTP/1.1 401 Authentication Failed
Www-Authenticate: Digest realm=“MyDomain", nonce="MDAwNDcwOTY6RHJheXRlaw==", algorithm="MD5", qop="auth"
Content-Length: 21
Connection: close
So I try to use CFHTTPMessageAddAuthentication to create authentication:
int scode = CFHTTPMessageGetResponseStatusCode(response);
int result = CFHTTPMessageAddAuthentication(request, response, (__bridge CFStringRef)user, (__bridge CFStringRef)pass, kCFHTTPAuthenticationSchemeDigest, (scode==407));
The result will always return 0, that means fail; but if I change the authenticationScheme to kCFHTTPAuthenticationSchemeBasic, the result will be good and it do append authentication info in request message but that is not what I want;
Do I miss something and cause the fail?
---