tomcat 中是否存在对接受盐的 JDBCRealm 的支持?

发布于 2024-11-14 05:25:00 字数 262 浏览 3 评论 0原文

我们当前使用的是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黑寡妇 2024-11-21 05:25:00
  1. 编写您自己的 JDBCRealmWithSalt 类,该类扩展 JDBCRealm
  2. 覆盖 digest() 方法(在此处添加您的盐)
  3. Put JDBCRealmWithSaltcatalina.jar:org/apache/catalina/realm
  1. Write your own JDBCRealmWithSalt class that extends JDBCRealm class
  2. Overwrite digest() method (add your salt here)
  3. Put JDBCRealmWithSalt in catalina.jar:org/apache/catalina/realm
  4. <Realm className="org.apache.catalina.realm.JDBCRealmWithSalt"...>
素染倾城色 2024-11-21 05:25:00

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/

笔落惊风雨 2024-11-21 05:25:00

从 Tomcat 8 开始,对于任何开箱即用的 Realm,您可以指定:

  • 所需的算法
  • 要使用的编码
  • salt
  • 迭代次数
  • 密钥长度

您可以在 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:

  • the desired algorithm
  • the encoding to be used
  • salt
  • number of iterations
  • key length

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文