Java 在Tomcat 7中扩展AuthenticatorBase

Java 在Tomcat 7中扩展AuthenticatorBase,java,tomcat,tomcat7,basic-authentication,form-authentication,Java,Tomcat,Tomcat7,Basic Authentication,Form Authentication,我正在尝试在Tomcat7中创建一个自定义验证器。 因此,我的理解是,我需要扩展AuthenticatorBase类(类似于FormAuthenticator),然后在web.xml中提到新的验证者的名称,类似这样: <login-config> <auth-method>CUSTOMAUTH</auth-method> </login-config> 客户授权 从自定义验证器类中创建一个Jar,并将其放入tomcatDir\lib中

我正在尝试在Tomcat7中创建一个自定义验证器。 因此,我的理解是,我需要扩展AuthenticatorBase类(类似于FormAuthenticator),然后在web.xml中提到新的验证者的名称,类似这样:

<login-config>
    <auth-method>CUSTOMAUTH</auth-method>
</login-config>

客户授权
从自定义验证器类中创建一个Jar,并将其放入tomcatDir\lib中\

现在我在哪里提到“CUSTOMAUTH”和我的类CustomAuthenticator.java之间的映射,比如com.authentication.custom.CustomAuthenticator.java

您能告诉我windows(我的开发环境)和Linux(我们的实际服务器)的配置文件的路径吗

如果我在上述任何一个步骤上有错误,请纠正我


提前感谢您的时间

您需要重写该方法

受保护的抽象字符串getAuthMethod()


这里必须返回CUSTOMAUTH

它是否在server.xml中?