tomcat 中是否存在对接受盐的 JDBCRealm 的支持?
我们当前使用的是 tomcat 5.5,并希望为我们的 JDBCRealm 身份验证添加盐。我想知道是否有任何现有的类,或者我们是否需要扩展 JDBCRealm 并编写我们自己的身份验证类?
我们的 server.xml 中有以下内容
<Realm className="org.apache.catalina.realm.JDBCRealm" ...more stuff… />
,但是这个类看起来并没有接受盐。
We are currently using tomcat 5.5 and would like to add a salt to our JDBCRealm authentication. I was wondering if there was any existing classes or do we need to extend JDBCRealm and write our own authentication class?
We have the following in our server.xml
<Realm className="org.apache.catalina.realm.JDBCRealm" ...more stuff… />
But it does not look like this class takes in a salt.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
JDBCRealmWithSalt
类,该类扩展JDBCRealm
类digest()
方法(在此处添加您的盐)JDBCRealmWithSalt
在catalina.jar:org/apache/catalina/realm
JDBCRealmWithSalt
class that extendsJDBCRealm
classdigest()
method (add your salt here)JDBCRealmWithSalt
incatalina.jar:org/apache/catalina/realm
<Realm className="org.apache.catalina.realm.JDBCRealmWithSalt"...>
Tomcat 5.5 API 中没有内置类,因此您必须使用自定义类。
可以在 http://eneuwirt.de/2011/05/01/saltawarejdbcrealm/ 找到一个示例
No existing classes as in built-in to the Tomcat 5.5 APIs, so you will have to use a custom one.
One example can be found at http://eneuwirt.de/2011/05/01/saltawarejdbcrealm/
从 Tomcat 8 开始,对于任何开箱即用的 Realm,您可以指定:
您可以在 CATALINA_HOME/bin/digest 中提供这些内容。 sh]
有关更多信息:https://tomcat.apache .org/tomcat-8.0-doc/realm-howto.html
As of Tomcat 8 for any shipped out-of-the-box Realm you can specify:
You would provide these in
CATALINA_HOME/bin/digest.[bat|sh]
For more information: https://tomcat.apache.org/tomcat-8.0-doc/realm-howto.html