Hi list:

I'm using the jakarta-image-taglib to generate thumbnails from my cms
contents, which are protected by a BASIC Authentication method.

How can i buld a jsp page to include the image taglib and set the
username/password required to fetch the files ?

Looking at the sources, i see this:

-------------------------------------------------------
protected InputStream getImageStream() throws JspException, IOException {

URLConnection connection = getCorrectedUrl(src).openConnection();

//TODO: Auth only if it is the same server

String auth = hreq.getHeader(AUTHORIZATION);

if (auth != null && auth.length() > 0) {

connection.setRequestProperty(AUTHORIZATION, auth);

}

return connection.getInputStream();

}

----------------------------------------------------------

So i suppose the authentication is possible, but i don't know how to set the
auth header, so the taglib can use it to manage the security for the new
connection.

Is there a way to do this in a general way, for example, at login time, so
the auth info used is the actual user logged in.

Thanks, and sorry for my rusty english.


Reply via email to