cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph White" <erstwhile...@gmail.com>
Subject Re: How do I use FileGenerator to get source from a URL that requires authentication (username/ password challenge)/
Date Fri, 27 Apr 2007 02:49:20 GMT
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:password@host: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. ...

On 4/25/07, Joerg Heinicke <joerg.heinicke@gmx.de> wrote:

> On 25.04.2007 04:58, Joseph White wrote:
> > The FileGenerator lets me access a website and get XML that I want to
> > present.  How do I include the necessary authentication (or allow the
> > authentication to "pop-up") so I can receive the XML output?
>
> It depends on the authentication scheme. It sounds like basic
> authentication, so there might be a way to encode it in the URL itself.
> It might be wrong or non-standard, but I remember something like
> http://user:password@mydomain.com.
>
> Regards
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Joseph White

Mime
View raw message