tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "martin" <mar...@cht.com.tw>
Subject A Question about Realm
Date Fri, 30 May 2003 03:21:53 GMT
Dear all.
I am from taiwan,I have some questions in using tomcat.

I have configured a realm to protect a web application and set it's web.xml like below.
I using a Form(auth.jsp) to authenticate  users.I have two questions.

1. What the contents of auth.jsp should be ? What 's the values of action and input's name
shoud be ?

<form name="authForm"  method="post" action="??">
  <input type="text" value="username" />             =>is this right ?
  <input type="password" value="password" />    =>is this right ?
</form> 

2. After the user is authenticated, how can I get the user's username,password,and role in
other pages ?

It's my first time to ask question here, and please exceuse my poor English.  
                                                                                         
                                           Thanks a lot.
--------

piece of web.xml file

 <security-constraint>
   <web-resource-collection>
     <web-resource-name>Apress Application</web-resource-name>
     <url-pattern>/*</url-pattern>
   </web-resource-collection>
   <auth-constraint>
    <role-name>apressuser</role-name>
   </auth-constraint>
  </security-constraint>

  <login-config>
   <auth-method>FORM</auth-method>
   <form-login-config>
    <form-login-page>/auth.jsp</form-login-page>
    <form-error-page>/err.htm</form-error-page>
   </form-login-config>
   <realm-name>Apress Application</realm-name>
  </login-config>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message