> I'm trying to use the slide client libs, but I just can't get
> authenticated right...
>
> I try to move a file with the following code:
>
> WebdavClient wdc = new WebdavClient(new URL(host),"root","mypass");
> wdc.setDebug(1);
> MoveMethod move = new MoveMethod(store + pp.getString("file"),
> "/slide/files/archives/" + pp.getString("file"));
> wdc.executeMethod(move);
> wdc.endSession();
>
> But the slide servlet gives me:
>
> Reopen connection : Host:209.131.74.71 Port:8180
> Request: MOVE /slide/files/temp/turbine/BL117-24.jpg HTTP/1.1
> 19 Mar 2001 11:24:28 - INFO - Copy /files/temp/turbine/BL117-24.jpg to
> /files/archives/BL117-24.jpg
> 19 Mar 2001 11:24:28 - INFO - Copy object : from
> /files/temp/turbine/BL117-24.jpg to /files/archives/BL117-24.jpg
> 19 Mar 2001 11:24:28 - WARNING - Access denied on /files/archives by
> user /users/guest for action /actions/write
>
> So my question is, does anyone know why am I getting logged on as a
> guest, when I specifiy root when I create the WebdavClient object?

HTTP authentication is passive. Unless you enable it on the server by
uncommenting the constraint in the web.xml file, nothing will happen.
Apparently, that's what happens here (you're still guest since nobody was
authenticated). OTOH, once HTTP auth is active, you don't have the concept
of unauthenticated user.

Slide fully delegates the auth to the servlet container, and uses the
getUserPrincipal call to retrive the Principal object. If that returns null,
that means that auth is inactive in the container, and it will use a guest
user to perform all operations (/users/guest here).

Note: Of course, you still need to update your realm so that root/mypass are
a valid set of credentials.

Remy

Reply via email to