Sergei:

Do you need to programmatically log in as a 'client' (e.g.
from a different JVM)?

If so, you will need to open an HttpUrlConnection with a url
that points to an appropriate page on your tomcat server.

Apache SOAP provides a nicelittle Http Tunneling tool that will
help you discover the details of what you need to send to Tomcat
(over an HTTP connection). Download Apache SOAP from
xml.apache.org. You don't need to 'install' it. The following
link explains how to use this tool:
   http://xml.apache.org/soap/docs/index.html

Start the tunnel gui, point your brower at it, and 'login' to your
web site. The tunnel gui will display all request and response
data. All that's left is to write code that sends the same
data that your browser did, and that knows how to deal with
the responses coming from tomcat.

Regards,

Tom Drake


----- Original Message -----
From: "Sergei Batiuk" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 5:48 AM
Subject: RE: Programmatic login with Tomcat 4.0.1


| Well, but what about programmatic login, i. e. something like
|
|   Context ctx = new InitialContext();
|   UserManager um = ( UserManager )ctx.lookup( "java:comp/UserManager" );
|   um.login( login, password );
|
| Does Tomcat have an API similar to this? The thing is I have a login form
on
| my first page, where a user should login to access protected functions
(they
| are not displayed by default, and become available only after a user has
| logged in).
|
| -----Original Message-----
| From: Ing. Gabriel Gajdos [mailto:[EMAIL PROTECTED]]
| Sent: Friday, January 04, 2002 3:24 PM
| To: [EMAIL PROTECTED]
| Subject: RE: Programmatic login with Tomcat 4.0.1
|
|
| If you use BASIC authentication, user/password are contained in the
| "Authorization" HTTP 1.1 Header (in Base64 encoded form).
| Never tried, but should work when supplying correct data into your HTTP
| request (including headers).
|
| | How do I programmatically login into TC 4.0.1?
| |
| | Sincirely,
| | Sergei Batiuk.
|
|
| --
| To unsubscribe:   <mailto:[EMAIL PROTECTED]>
| For additional commands: <mailto:[EMAIL PROTECTED]>
| Troubles with the list: <mailto:[EMAIL PROTECTED]>
|
|
|
| --
| To unsubscribe:   <mailto:[EMAIL PROTECTED]>
| For additional commands: <mailto:[EMAIL PROTECTED]>
| Troubles with the list: <mailto:[EMAIL PROTECTED]>
|
|
|


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

Reply via email to