Hello [EMAIL PROTECTED]

On 25-Jan-00, [EMAIL PROTECTED] wrote:
> On Tue, 25 Jan 2000 [EMAIL PROTECTED] wrote:
>> [EMAIL PROTECTED] wrote:
>>> with the same results.  Is this just broken?
>> 
>> Have no experience with IIS, but have you tried trace/net: true to see
>> more console net-info output?
>> 
> 
> Petr,
> 
> here's the results of turning on the trace...
> 
>>> trace/net on
>>> do %getsecurepage.r
> Script: "Secure Page Retreival" (25-Jan-2000)
> http://webuser:[EMAIL PROTECTED]/mysite/
> URL Parse: webuser letmein 127.0.0.1 none mysite/ none
> Net-log: ["Opening tcp for" HTTP]
> connecting to: 127.0.0.1
> Net-log: {GET /mysite/ HTTP/1.0
> Accept: */*
> User-Agent: REBOL 2.2.0.3.1
> Host: 127.0.0.1
> Authorization: Basic d2VidXNlcjpsZXRtZWlu
> 
> }
> Net-log: "HTTP/1.1 401 Access Denied"
> ** User Error: Error.  Target url: http://127.0.0.1/mysite/ could not be
> retrieved.  Server r
> esponse: HTTP/1.1 401 Access Denied.
> ** Where: print read http_file
> 
> To me - it looks like REBOL simply parses out the username:password from
> the URL.  But I'm not sure what the results of the trace mean.  I can see
> that the Authorization chalenge comes up - the little box that pops up in
> your browser when accessing a password protected resource is referred to
> as "Basic Authentication" - not just in Microsoft's parlance.
> 
> So - I'd say the server is responding appropriately - but that REBOL isn't
> reacting to it correctly, and not handing it the username and password...
> 
> - Porter Woodward
> 
> 

you can try 
the following:

REBOL [
    Title: "Password Page Retreival"
    Date:  25-Jan-2000
    Purpose: "A script to fetch a web page that uses basic authentication"
    File:  %getsecurepage.r
    Notes: {
    A quick test of the scheme mechanism of reading a URL -
    this should allow for retrieval of web pages that are
    located behind a password protected challenge.
    }
]

 http-port: open/lines [
  scheme: 'tcp
  port-id: 80
  timeout: 0:10 
  host: "127.0.0.1"
 ]

msg: rejoin [{ GET /mysite/default.htm HTTP/1.1
Host: localhost
Authorization:} enbase username:password ]

; change default.htm, password and username to whatever you set on IIs

insert http-port msg

buffer: make string! 10000
    tmp-buffer: reform ["HTTP-Response:" pick http-port 1]
    while [not none? tmp-buffer] [
        append buffer rejoin [tmp-buffer "^/"]
        tmp-buffer: pick http-port 1
    ]
print buffer
close http-port

please note that this are fragments of code quickly paste together and not
tested. Its a part of a much larger progect im working on.
It works for me.

Dinos

Reply via email to