• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFHTTPMessageAddAuthentication problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFHTTPMessageAddAuthentication problem


  • Subject: Re: CFHTTPMessageAddAuthentication problem
  • From: joby abraham <email@hidden>
  • Date: Fri, 29 Nov 2013 12:51:30 +0530

Kevin,

You are getting return code 0 from CFHTTPMessageAddAuthentication its only because the web site you are trying to communicate does not support Digest Authentication. You can use CFHTTPMessageCopyAllHeaderFields(Response)for display all the header field and find authentication methods which supported by the Web Site.

Thank you,
Joby Abraham.

On Fri, Nov 29, 2013 at 10:03 AM, Kevin Yu <email@hidden> wrote:
Hi there,

This is for iOS platform, both iOS6 and iOS7 got the same issue.
I’ve a HTTP request and Response looks like the following:

request:
GET /cwm/CRN.html HTTP/1.1
Host: 10.5.5.1:8069
User-Agent: MyAgent
Connection: keep-alive

response:
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?


---
regards,
KC


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



--
Thanks & Regards,
Joby Abraham.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CFHTTPMessageAddAuthentication problem
      • From: Kevin Yu <email@hidden>
References: 
 >CFHTTPMessageAddAuthentication problem (From: Kevin Yu <email@hidden>)

  • Prev by Date: CFHTTPMessageAddAuthentication problem
  • Next by Date: Re: CFHTTPMessageAddAuthentication problem
  • Previous by thread: CFHTTPMessageAddAuthentication problem
  • Next by thread: Re: CFHTTPMessageAddAuthentication problem
  • Index(es):
    • Date
    • Thread