HTTP authenticated components and Safari not working
HTTP authenticated components and Safari not working
- Subject: HTTP authenticated components and Safari not working
- From: Benjamin Adair <email@hidden>
- Date: Mon, 23 Feb 2004 13:54:18 -0600
Hi all,
I've been working on creating an authenticated component class for our
applications, mainly by following Apple's legacy docs for WO 4.5.
Thankfully that is in Java and only needed a little tweaking.
Things are working just fine with every browser other than Safari -it
seems. Omniweb, Mozilla, Netscape, IE on Windows all pop up the login
prompt and the user can successfully authenticate and see the
component's content. Safari, on the other hand, never displays a login
prompt. I've tried on several machines, cleared the cache, etc all to
no avail. Is there a gotcha I'm stumbling across with Safari? (1.1.1
(v100.1)) Looking at my WOResponse, everything it's sending seems to
conform to the HTTP Auth RFC... Oh, and did I mention the other
browsers dig it?
Here is the relevant code, I think:
NSData errorBytes;
String errorText = "<HTML><BODY><H2>HTTP/1.0 401 Unauthorized
Access</H2></BODY></HTML>";
errorBytes = new NSData( errorText.getBytes() );
aResponse.setContent( errorBytes );
aResponse.setHeader( String.valueOf( errorBytes.length() ),
"content-length" );
aResponse.setHeader("text/html" , "content-type");
aResponse.setStatus(401);
aResponse.setHeader( "Basic realm=\"" + aRealm + "\"" ,
"WWW-Authenticate" );
I've tried playing with the header items being quoted or not.. Having
no content at all.. I'm out of ideas as to what to try to make Safari
happy. As my coworker stated.. It's kinda funny my Apple product isn't
happy with my Apple product.
Thanks in advance!
Ben
--
Benjamin Adair
Central Office Database Programmer/Analyst
Cancer & Leukemia Group B
Phone: 773-702-6731
Fax: 312-345-0117
Email: email@hidden
Web: http://www.calgb.org/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.