【问题标题】:Connecting Apache Shiro and Cassandra Database连接 Apache Shiro 和 Cassandra 数据库
【发布时间】:2018-03-01 01:39:18
【问题描述】:

如何在 web 项目中实现 Apache Shiro 和 Cassandra 数据库之间的连接,以便 shiro 会话管理从 Cassandra 数据库中获取用户名和密码?

我有一个 Web 项目(木偶),其中有一个登录表单。我希望 shiro 基于从 Cassandra 数据库读取的用户名和密码执行身份验证,而不是 shiro.ini 文件。

我无法在两者之间建立联系。

我点击了以下链接,但它使用 shiro ini 文件而不是 cassandra 数据库来验证用户。

https://github.com/lhazlewood/shiro-cassandra-sample

【问题讨论】:

    标签: spring cassandra marionette shiro


    【解决方案1】:

    您发布的链接使用 Cassandra 存储当前会话(在集群中)

    如果您想存储用户/密码信息,您需要创建自己的 Realm。

    见:http://shiro-user.582556.n2.nabble.com/How-to-add-a-role-to-the-subject-td5562700.html (或以 Shiro 中的任何现有 Realms 为例)

    【讨论】:

      猜你喜欢
      • 2018-02-14
      • 2017-08-05
      • 2017-06-16
      • 2014-07-07
      • 2011-07-26
      • 2021-03-22
      • 2015-04-25
      • 2014-04-11
      • 2018-02-11
      相关资源
      最近更新 更多