Anton, Brian
I've found the problem.
Does your password or user-id contain a space?
Example from RFC2617
<!--StartFragment-->To receive authorization, the client sends the userid
and password,
separated by a single colon (":") character, within a base64 [7]
encoded string in the credentials.
basic-credentials = base64-user-pass
base64-user-pass = <base64 [4] encoding of user-pass,
except not limited to 76 char/line>
user-pass = userid ":" password
userid = *<TEXT excluding ":">
password = *TEXT
Userids might be case sensitive.
If the user agent wishes to send the userid "Aladdin" and password
"open sesame", it would use the following header field:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
--------------------------------------------------------------------
OK lets try this..
enbase join "Aladdin" [":" "open sesame"]
== "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
Cool that creates the correct one, but the problem we have is
when we include the it as part of the URL. The space is URL encoded.
(confirmed from reading a trace)
http://Alladin:[EMAIL PROTECTED]/file
So Rebol will send the wrong code..
enbase join "Aladdin" [":" "open%20sesame"]
== "QWxhZGRpbjpvcGVuJTIwc2VzYW1l"
And hence we get the dreaded 401 Not Authorised Error
So if you have this problem then use the following method to access the page
instead.
print read [
scheme: 'http
host: "fortytheives.com"
user: "Alladin"
pass: "open sesame"
path: "path/to/file/"
target: "file.ext"
]
I'm sending in a feedback on this..
Cheers,
Allen K
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 08, 2000 8:42 PM
Subject: [REBOL] http authorisation - how? Re:(2)
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, June 03, 2000 6:17 AM
> Subject: [REBOL] http authorisation - how? Re:
>
>
> > [EMAIL PROTECTED] wrote:
> > >What I want to do is download a html page that requires authorisation.
> > >I tried inserting the user name and password in the same fashion as
> > >email downloading:
> > >
> > >read http://user:[EMAIL PROTECTED]
> > >
> > >but it gives "...server response: .. 401 Unauthorized."
> >
> > There are two kinds of http authorization, basic and digest. Basic sends
> > a clear-text userid and password as part of the headers. Digest sends an
> > MD5 message digest of the password - it is newer and more secure.
> >
> > At this point, REBOL only supports basic authentication. Apparently the
> > server you're connecting to doesn't downgrade to basic authentication
> > for security reasons.
> >
> > You may be out of luck, Anton :(
> >
> > Brian Hawley
> >
> >
> Yes I've struck this today to, on a server that is supposed to be using
> Basic Authentication. Does
> anyone have confirmation that the Basic Authentication is working?
>
> Cheers,
>
> Allen K
>
>
>
>