tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viorel C." <ad...@velfina.com>
Subject Re: FORM based authentication config
Date Tue, 21 Dec 2004 22:30:23 GMT
On Tue, 2004-12-21 at 16:15, Chris Chappell wrote:
> Hi I'm having trouble getting form based authentication to work. Any help much appreciated.
> I'm missing something simple I'm sure. (TC 5.0.19, W2K, Mysql4) 
> 
> I am using a JDBC Realm which works fine with BASIC auth.
> 
> After changing to FORM and try http://127.0.0.1:8080/MyApp/security/protected/login.jsp
I get:
> The requested resource (/MyApp/security/protected/login.jsp) is not available.
>  
> To set this up I copied the files from the JSP examples - login.jsp, error.jsp in folders
\security\protected to \MyApp\security\protected\
> I copied web.xml parts:
> 
>   <servlet>
>         <servlet-name>org.apache.jsp.security.protected_.error_jsp</servlet-name>
>         <servlet-class>org.apache.jsp.security.protected_.error_jsp</servlet-class>
>     </servlet>
> 
>     <servlet>
>         <servlet-name>org.apache.jsp.security.protected_.index_jsp</servlet-name>
>         <servlet-class>org.apache.jsp.security.protected_.index_jsp</servlet-class>
>     </servlet>
> 
>     <servlet>
>         <servlet-name>org.apache.jsp.security.protected_.login_jsp</servlet-name>
>         <servlet-class>org.apache.jsp.security.protected_.login_jsp</servlet-class>
>     </servlet>
> 
>   and mappings
> 
> <servlet-mapping>
>         <servlet-name>org.apache.jsp.security.protected_.error_jsp</servlet-name>
>         <url-pattern>/security/protected/error.jsp</url-pattern>
>     </servlet-mapping>
> 
>     <servlet-mapping>
>         <servlet-name>org.apache.jsp.security.protected_.index_jsp</servlet-name>
>         <url-pattern>/security/protected/index.jsp</url-pattern>
>     </servlet-mapping>
> 
>     <servlet-mapping>
>         <servlet-name>org.apache.jsp.security.protected_.login_jsp</servlet-name>
>         <url-pattern>/security/protected/login.jsp</url-pattern>
>     </servlet-mapping>
> 
> with 
> 
> <security-constraint>
>     <web-resource-collection>
>       <web-resource-name>Calendar</web-resource-name>
>       <url-pattern>/Calendar</url-pattern>
>       <!-- ...more... -->
> 
>     </web-resource-collection>
>     
>     <auth-constraint>
>       <role-name>user</role-name>
>       <role-name>admin</role-name>
>       <role-name>sysadmin</role-name>
>     </auth-constraint>
>   </security-constraint>
> 
> and configured 
> 
> <login-config>
>     <auth-method>FORM</auth-method>
>     <realm-name>MyApp</realm-name>
>     <form-login-page>/security/protected/login.jsp</form-login-page>
>     <form-error-page>/security/protected/error.jsp</form-error-page>
>   </login-config>
> 
> 
> 
> Chris
Try to use static resources for the form-login-page and form-error-page.
It works for me. And skip servlet mapping

Viorel


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message