Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / November 2006



Tip: Looking for answers? Try searching our database.

CFHTTPMessageAddAuthentication problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ulrich Hobelmann - 21 Nov 2006 22:24 GMT
I want to base64-encode a username and password (i.e. I want it as a
string), and I thought it would be cool to do that with CF functions
(so I don't have to write the whole base64 stuff, or download some
hacked-together library for that).

I create a CFHTTPMessageRef with ...CreateResponse(..., 401,...).  I
set its header field to the usual WWW-authenticate record; I set its
body to an NSData from an empty string.

I do the same to create a request (with a random URL).

When I call CFHTTPMessageAddAuthentication(request, response, myUser,
myPass, kCFHTTPAuthenticationSchemeBasic, FALSE), I get a crash.
(afterwards, I would have extracted the header value to get my string)

Does anybody have an idea why?  After all, I created nice, clean
HTTPMessage objects with Apple's own functions, and I even set all
their values...
brianhray@gmail.com - 27 Nov 2006 15:51 GMT
Maybe something you pass in to make the CFHTTPMessageRef is NULL. Its
really hard to tell with the information you gave. If you still have
the problem, why don't you print out the call stack and some code to
reproduce?

-- Brian Ray (http://kazavoo.com)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.