On 27.04.2007 04:49, Joseph White wrote:
I would expect the the basic authentication scheme to be used within the
FileGenerator .. but I don't know where to pass in the username:password
for
my case using the username:[EMAIL PROTECTED]:port directly in a browser to the
site I am interested in does not work. Are you saying that the cocoon
FileGenerator will strip the username:password part and, in effect to the
following:
1. URL url = new URL(urlstring);
2. String userPassword = theUsername + ":" + thePassword;
3. String encoding = new sun.misc.BASE64Encoder().encode(
userPassword.getBytes());
4. URLConnection uc = url.openConnection();
5. uc.setRequestProperty("Authorizatio","Basic " + encoding);
6. ...
Hi Joseph,
it took some time until I found the time to find out who does what:
"username:[EMAIL PROTECTED]:port" is indeed mentioned in the actual standard
[1]. And Cocoon's source resolving (based on/ using Apache Excalibur
source resolving) does indeed execute the code you wrote above [2]. The
rest is done by JDK's java.net.URL and URLStreamHandler.
So it should indeed work the way I wrote.
If it does not work for you when directly used in the browser it might
be that another URL handling is used on the server you are requesting
the page from. But FileGenerator uses the way described.
Joerg
[1] http://www.ietf.org/rfc/rfc2396.txt,
section 3.2.2. Server-based Naming Authority
[2]
http://svn.apache.org/viewvc/excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java?annotate=492442,
starting line 160
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]