Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/11/2005, 12:19
CARCAHARAS
 
Fecha de Ingreso: mayo-2005
Mensajes: 294
Antigüedad: 19 años, 10 meses
Puntos: 0
Autenticacion De Usuarios Con Tomcat

HOLA TENGO UNA APLICACION Y QUIERE PROTEGER ALGUNOS RECURSOS DE LA MISMA. MI ESTRUCTURA DE DIRECTORIOS ES LA SIGUIENTE:

SERVAUTO
.ALUMNO
.PROFESOR
.JST
.PROFESOR (Aqui estan los recursos que quiero proteger
.ALUMNO
.WEB INF

La manera en que quiero controlar el acceso es configurando un File-Based Realm para ello he seguido estos pasos:


PRIMERO HE CONFIGURADO EL SERVER.XML DE MI TOMCAT QUE ES LA VERSIÓN 5.0.30 HE PUESTO:

<Realm className="org.apache.catalina.realm.MemoryRealm"/>

LO SIGUIENTE HE CONFIGURADO EL WEB.XML DE MI APLICAICION ASÍ:

<!--Describe a DataSource-->
<resource-ref>
<res-ref-name>jdbc/Servauto</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


<!--ESTO LO HAGO PARA LA AUTENTIFICACION Y AUTORIZACION DE UN USUARIO -->

<!--Define a Security Constraint on this application-->
<security-constraint>
<web-resource-collection>
<web-resource-name>SERVAUTO PROFESOR</web-resource-name>
<url-pattern>/jst/PROFESOR/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>administrador</role-name>
</auth-constraint>
</security-constraint>

<!--Define the Login configuration for this Application-->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>SERVAUTO PROFESOR</realm-name>
</login-config>

<!--Security roles referenced by this Web application-->
<security-role>
<description>Es el rol requerido para acceder a la parte del profesor de la aplicación</description>
<role-name>administrador</role-name>
</security-role>


LO QUE ME PASA ES QUE EJECUTO LA APLICAICIÓN, ACCEDO A UNO DE ESOS RECURSOS( QUE SON PAGINAS HTML) Y NO ME APARECE NADA, ME DEJA ACCEDER SIN MÁS

¿POR QUÉ PUEDE SER?NECESITO AYUDA MUCHAS GRACIAS!