• 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
url authorization?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

url authorization?


  • Subject: url authorization?
  • From: Francis Lachapelle <email@hidden>
  • Date: Fri, 15 Mar 2002 17:47:58 -0500 (EST)

Hi

I'm trying to fetch a HTML page that requires user authentication. I'm
using NSURL and it simply doesn't work.

I first tried the easy way, by defining my URL string with the following
pattern:

http://<username>:<password>@<host>:<port>/<url-path>

I did the test on my personal web server (Apache) and I could check
from the log files that no authorization was sent with the request.

I verified RFC 1738 (section 3.1) and it looks like this username/password
syntax is not actually standard for the http protocol (only ftp!?).

So I tried to define explicitly the authorization header. Section 11.1 of
RFC 1945 explains the basic authorization scheme, which is the scheme I
wanted to use. To set the header value, I used the "setProperty:forKey:"
method of the NSURL class.

[url setProperty: @"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" forKey:
@"Authorization"];

Still no success. No authorization request. Since Apple's documentation
for the NSURL class is not complete, I don't know if I'm using the right
methods.

What it very embarassing though is that both approches work great under
Linux with GNUstep .. :/

Any help would be greatly appreciated!

If anyone wants to perform some tests, I would suggest using Apple's
mailing list archvies :)

NSURL *url = [NSURL URLWithString:
@"http://lists.apple.com/archives/cocoa-dev/2001/Jul/18.html";];
[url setProperty: @"Basic YXJjaGl2ZXM6YXJjaGl2ZXM=" forKey:
@"Authorization"];

Thanks!

Francis

--


[francis@chicgeek ~]$ od -c -N 120 /dev/random > ~/.signature
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: NSCell Question?
  • Next by Date: Re: Filtering all keyboard input in an NSTextView
  • Previous by thread: NSCell Question?
  • Next by thread: Re: Yet another NSOutlineView question...
  • Index(es):
    • Date
    • Thread