【问题标题】:extend AuthenticatorBase in Tomcat 7在 Tomcat 7 中扩展 AuthenticatorBase
【发布时间】:2016-10-14 10:23:39
【问题描述】:

我正在尝试在 Tomcat 7 中创建自定义身份验证器。 所以,我的理解是,我需要扩展 AuthenticatorBase 类(类似于 FormAuthenticator),然后在 web.xml 中提及新的身份验证器的名称,如下所示:

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

从 Custom Authenticator 类中创建一个 Jar 并放入 tomcatDir\lib\

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

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

如果我对上述任何步骤有误,请纠正我。

提前感谢您的宝贵时间!

【问题讨论】:

  • 是否在 server.xml 中?

标签: java tomcat tomcat7 basic-authentication form-authentication


【解决方案1】:

您需要重写该方法

protected abstract String getAuthMethod();

这里你必须返回 CUSTOMAUTH

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-15
    • 1970-01-01
    • 2016-03-14
    • 1970-01-01
    相关资源
    最近更新 更多