On Fri, 25 Jan 2002, Christian Cryder wrote:

> Date: Fri, 25 Jan 2002 23:31:28 -0700
> From: Christian Cryder <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat-User <[EMAIL PROTECTED]>
> Subject: Accessing Manager app through URLConnection
>
> Ok, how can I go about accessing the Manager app through a URL connection?
> Its currently generating a 401 error code, and I know the reason is because
> of the role stuff...how can I programatically assign a role? Or is there a
> way I can pass the user/pwd info along with the url poarameters somehow? I'd
> greatly appreciate some ideas on this...
>

Hi Christian,

You are indeed getting a 401 error because the manager webapp is protected
by a security constraint using BASIC authentication.  If you run it from a
browser, you get the usual pop-up dialog.

To use automated connections, your client code is going to have to create
an "Authorization" header that encodes the username and password, in the
format required by RFC 2617, and include it with the request to bypass the
401 dialog.  One source of code you could use to figure out what's
necessary is in the HEAD branch of the Tomcat 4 repository -- in class
org.apache.catalina.ant.AbstractCatalinaTask.  (As the name implies, this
is the base class for a set of custom Ant tasks that interact with the
Manager webpp, documented on the "manager-howto.html" page in the nightly
builds of Tomcat 4.

> THanks,
> Christian
>

Craig McClanahan


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to