【问题标题】:JCIFS authenticate with hashed passwordJCIFS 使用散列密码进行身份验证
【发布时间】:2014-06-19 15:49:24
【问题描述】:

我正在使用 spring-security LDAP 来验证我的应用程序中的用户。我想使用经过身份验证的用户凭据访问 samba 共享。我使用 JCIFS 库:http://jcifs.samba.org/

SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 获取 UserDetails 只会给我用户的散列 (SHAA) 密码。是否可以使用此哈希来验证 JCIFS 而不是纯文本密码?

【问题讨论】:

    标签: java spring authentication jcifs


    【解决方案1】:

    我无法使用散列密码,但对于我的用例,spring security 提供了配置来保留纯密码:

    <authentication-manager erase-credentials="false">
    

    有了这个配置,你可以通过以下方式获取密码:

    (String) SecurityContextHolder.getContext().getAuthentication().getCredentials();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-29
      • 2016-07-15
      • 2020-02-28
      • 1970-01-01
      • 2016-04-05
      • 2015-12-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多