• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Form Authenticatior is not getting executed with tomcat 7

 
Amit Singhall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Custom Form Authenticatior is not getting executed with tomcat 7.

I am using the embeded tomcat in my java application.

I am setting the custom realm on engine level
engine.setRealm(realm);
Then I am adding the my custome form authenticator on the context level
StandardContext root = (StandardContext) tomcat.addWebapp(host,"/myApp","/myApp", catalinaHome + "/webapps/myApp");
CustomFormAuthenticator formAuth = new CustomFormAuthenticator ();
formAuth.setDisableProxyCaching( false );
root.addValve(formAuth);

The CustomFormAuthenticator was running in tomcat 5 , but when I upgraded to tomcat 7 , it stopped executing. I have recompiled all the classes with new tomcat libabries. And also I am using Tomcat class instead of Embedded(deprecated in tomcat 7).
Tomcat Server is getting started but the CustomFormAuthenticator is not getting executed.

Here is the snippet from web.xml


<security-constraint>
<display-name>Custom Framework Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Custom Framework Authentication Required Area</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Custom Role</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login</form-login-page>
<form-error-page>/loginError</form-error-page>
</form-login-config>
</login-config>

<!-- Define the security roles referenced by this web application. -->
<security-role>
<role-name>Custom Role</role-name>
</security-role>

 
Amit Singhall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like the SecurityConstraints are not getting picked for the context.

I am getting this message in the log
" No applicable constraints defined"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic